Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5245a905 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

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: default avatarJohan Hovold <johan@hovoldconsulting.com>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent a6e0363c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -510,7 +510,7 @@ int gb_connection_bind_protocol(struct gb_connection *connection)
				   connection->major,
				   connection->major,
				   connection->minor);
				   connection->minor);
	if (!protocol) {
	if (!protocol) {
		dev_warn(&connection->bundle->dev,
		dev_warn(connection->hd->parent,
				"protocol 0x%02hhx version %hhu.%hhu not found\n",
				"protocol 0x%02hhx version %hhu.%hhu not found\n",
				connection->protocol_id,
				connection->protocol_id,
				connection->major, connection->minor);
				connection->major, connection->minor);