No description
Find a file
Alex Elder 9ade6d3122 greybus: battery: free struct on error in caller
When a battery connection is initialized, a gb_battery structure for
it is allocated in gb_battery_connection_init().  Currently that
function ends by calling init_and_register(); in the event an error
occurs, init_and_register() is responsible for freeing the allocated
gb_battery structure.

Make the code a bit better balanced by having the function that
allocates the structure be responsible for freeing it in case of
error.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-07 22:55:43 +02:00
drivers/staging/greybus greybus: battery: free struct on error in caller 2015-05-07 22:55:43 +02:00