OSDN Git Service

greybus: loopback: fix connection cleanup paths
authorAlex Elder <elder@linaro.org>
Mon, 3 Aug 2015 17:57:20 +0000 (12:57 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 4 Aug 2015 03:13:19 +0000 (20:13 -0700)
commit1fb807cf6da0b65af4ba6ab100d38ebef17ff25e
tree9a0d0dd172722f0b1761ced1edd3c5d7807d6628
parentff71d395f3cd5e5efe4b9b3c94c2d41581fb9d8c
greybus: loopback: fix connection cleanup paths

The error paths in gb_loopback_connection_init() are kind of screwed
up--not in proper order, and the label naming convention seems a
little inconsistent.

Fix this, ensuring each error cleans up the setup that's been done
up to that point.  Use the convention that the label indicates the
first thing that needs to be cleaned up.

Reorder the statements in gb_loopback_connection_exit() to match
the order of cleanup in gb_loopback_connection_init().

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c