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 01dcf18c96011b1bca7b4734849850da0ff69b6c..c49cc7ea4b28315d1fdb215152ef19bc55e7f5fb 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;