android_kernel_samsung_msm8976/drivers/leds
Russell King 5d33fff5ca leds: leds-pwm: properly clean up after probe failure
commit 392369019eb96e914234ea21eda806cb51a1073e upstream.

When probing with DT, we add each LED one at a time.  If we find a LED
without a PWM device (because it is not available yet) we fail the
initialisation, unregister previous LEDs, and then by way of managed
resources, we free the structure.

The problem with this is we may have a scheduled and active work_struct
in this structure, and this results in a nasty kernel oops.

We need to cancel this work_struct properly upon cleanup - and the
cleanup we require is the same cleanup as we do when the LED platform
device is removed.  Rather than writing this same code three times,
move it into a separate function and use it in all three places.

Fixes: c971ff185f ("leds: leds-pwm: Defer led_pwm_set() if PWM can sleep")
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-07 13:25:34 -07:00
..
trigger leds: add camera LED triggers 2013-04-01 11:04:50 -07:00
dell-led.c
Kconfig Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
led-class.c
led-core.c
led-triggers.c
leds-88pm860x.c leds: 88pm860x: Add missing of_node_put() 2013-02-06 16:00:43 -08:00
leds-adp5520.c
leds-asic3.c leds: leds-asic3: switch to using SIMPLE_DEV_PM_OPS 2013-04-01 11:04:54 -07:00
leds-atmel-pwm.c leds: atmel-pwm: remove erroneous __exit annotation 2013-04-01 11:04:48 -07:00
leds-bd2802.c leds: leds-bd2802: add CONFIG_PM_SLEEP to suspend/resume functions 2013-04-01 11:04:53 -07:00
leds-blinkm.c
leds-clevo-mail.c
leds-cobalt-qube.c
leds-cobalt-raq.c
leds-da903x.c
leds-da9052.c
leds-dac124s085.c
leds-fsg.c
leds-gpio-register.c
leds-gpio.c leds: leds-gpio: reserve gpio before using it 2013-05-21 11:26:53 -07:00
leds-hp6xx.c
leds-lm355x.c leds: lm355x, lm3642: support camera LED triggers for flash and torch 2013-04-01 11:04:50 -07:00
leds-lm3530.c
leds-lm3533.c
leds-lm3642.c leds: lm355x, lm3642: support camera LED triggers for flash and torch 2013-04-01 11:04:50 -07:00
leds-locomo.c
leds-lp55xx-common.c leds: lp55xx: use common clock framework when external clock is used 2013-04-01 11:04:53 -07:00
leds-lp55xx-common.h leds: lp55xx: use common clock framework when external clock is used 2013-04-01 11:04:53 -07:00
leds-lp3944.c
leds-lp5521.c leds: lp55xx: configure the clock detection 2013-04-01 11:04:53 -07:00
leds-lp5523.c
leds-lp5562.c leds: lp55xx: configure the clock detection 2013-04-01 11:04:53 -07:00
leds-lp8788.c
leds-lt3593.c leds: leds-lt3593: set devm_gpio_request_one() flags param correctly 2013-04-01 11:04:49 -07:00
leds-max8997.c
leds-mc13783.c
leds-net48xx.c
leds-netxbig.c
leds-ns2.c leds: leds-ns2: fix oops at module removal 2013-04-01 11:04:52 -07:00
leds-ot200.c drivers/leds/leds-ot200.c: fix error caused by shifted mask 2013-05-24 16:22:51 -07:00
leds-pca955x.c
leds-pca9532.c
leds-pca9633.c
leds-pwm.c leds: leds-pwm: properly clean up after probe failure 2014-06-07 13:25:34 -07:00
leds-rb532.c
leds-regulator.c
leds-renesas-tpu.c leds: renesas: set gpio_request_one() flags param correctly 2013-04-01 11:04:49 -07:00
leds-s3c24xx.c
leds-ss4200.c
leds-sunfire.c leds: leds-sunfire: use dev_err()/pr_err() instead of printk() 2013-02-06 16:00:43 -08:00
leds-tca6507.c leds: tca6507: Use of_match_ptr() macro 2013-04-01 11:04:50 -07:00
leds-wm831x-status.c leds: wm831x-status: Request a REG resource 2013-09-26 17:18:27 -07:00
leds-wm8350.c leds: wm8350: Complain if we fail to reenable DCDC 2013-04-01 11:04:49 -07:00
leds-wrap.c
leds.h
Makefile leds: move LED trigger drivers into new subdirectory 2013-04-01 11:04:48 -07:00