From: Viresh Kumar Date: Mon, 31 Aug 2015 11:51:15 +0000 (+0530) Subject: greybus: connection: protocol can be NULL in gb_connection_exit() X-Git-Tag: v4.9.8~1233^2~378^2~21^2~1221 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c0d57b4e612c00b14852c2f8b179d518462ea6c;p=platform%2Fkernel%2Flinux-rpi3.git greybus: connection: protocol can be NULL in gb_connection_exit() gb_connection_exit() is getting called from gb_connection_destroy() now, which will get called from failure path of gb_connection_create_range() (in a later commit). And at that point connection->protocol will be NULL. Don't print an error message if this happens in gb_connection_exit(). Signed-off-by: Viresh Kumar Signed-off-by: Johan Hovold --- diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index d0642bc..466ea36 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -396,10 +396,8 @@ disconnect: static void gb_connection_exit(struct gb_connection *connection) { - if (!connection->protocol) { - dev_warn(&connection->dev, "exit without protocol.\n"); + if (!connection->protocol) return; - } spin_lock_irq(&connection->lock); if (connection->state != GB_CONNECTION_STATE_ENABLED) {