greybus: connection: destroy connection on failing to bind it
authorFabien Parent <fparent@baylibre.com>
Tue, 13 Oct 2015 15:34:51 +0000 (17:34 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 14 Oct 2015 18:54:51 +0000 (11:54 -0700)
commit67b81757dad8979e0cd85512fc0e5dfe80e2e96f
tree6ff6d0bfe735fcb583164f121bf9ba3391501d4e
parent82ee1e6cde3d9500f3dfc9cefc259b89e87a8865
greybus: connection: destroy connection on failing to bind it

gb_connection_bind_protocol() returns proper error codes now and we
should destroy the connection on failures.

This change also fixes a NULL deref on hotplug when the control connection fails
to initialize.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/connection.c