greybus: connection: fix potential null-deref when binding protocol
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 3 Nov 2015 11:11:27 +0000 (12:11 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 5 Nov 2015 04:20:23 +0000 (20:20 -0800)
We can have connections without bundles so we must not use the bundle
device for error messages when failing to look up a protocol.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/connection.c

index c3cd69c0f3ed49687ac6f086a77a89e1c1153269..294e72e8e1c0bcd18436b2d2e039e13c477e8d3c 100644 (file)
@@ -510,7 +510,7 @@ int gb_connection_bind_protocol(struct gb_connection *connection)
                                   connection->major,
                                   connection->minor);
        if (!protocol) {
-               dev_warn(&connection->bundle->dev,
+               dev_warn(connection->hd->parent,
                                "protocol 0x%02hhx version %hhu.%hhu not found\n",
                                connection->protocol_id,
                                connection->major, connection->minor);