greybus: connection: fix potential null-deref when binding protocol

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>
This commit is contained in:
Johan Hovold 2015-11-03 12:11:27 +01:00 committed by Greg Kroah-Hartman
parent a6e0363cb0
commit 5245a90564

View 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);