greybus: connection: fix potential null-deref in connection create
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 3 Nov 2015 11:11:28 +0000 (12:11 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 5 Nov 2015 04:20:23 +0000 (20:20 -0800)
We allow connections without bundles so we must not use the bundle
device for error messages after binding the 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 e16ed4eafd036803486c5d43a0adc3ef222e687b..c3cd69c0f3ed49687ac6f086a77a89e1c1153269 100644 (file)
@@ -170,7 +170,7 @@ gb_connection_create_range(struct greybus_host_device *hd,
 
        retval = gb_connection_bind_protocol(connection);
        if (retval) {
-               dev_err(&bundle->dev, "%d: failed to bind protocol: %d\n",
+               dev_err(parent, "%d: failed to bind protocol: %d\n",
                        cport_id, retval);
                gb_connection_destroy(connection);
                return NULL;