greybus: lights: avoid channel torch double free
authorRui Miguel Silva <rui.silva@linaro.org>
Thu, 3 Dec 2015 16:07:48 +0000 (16:07 +0000)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 3 Dec 2015 23:33:34 +0000 (15:33 -0800)
When attaching torch to a flash we release the channel torch resources,
but afterwards we do it again when releasing all the channels.
Just free all the resource at channel release.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/light.c

index 01dcf18..c49cc7e 100644 (file)
@@ -681,9 +681,6 @@ static int __gb_lights_channel_torch_attach(struct gb_channel *channel,
        kfree(channel->led->name);
        channel->led->name = name;
 
-       /* free original torch channel resources */
-       gb_lights_channel_free(channel_torch);
-
        channel_torch->led = channel->led;
 
        return 0;