diff options
| author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2019-04-15 19:37:32 -0400 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2019-04-16 10:43:19 -0400 |
| commit | 11e600a8c79db090688475074a6ad13234f07541 (patch) | |
| tree | f6dbeac04014102cb313622e8a25bad13f242525 | |
| parent | 81717283cf2c4c4d9bf8fd618cd6e5bdfe082edd (diff) | |
ARM: OMAP1: ams-delta: fix early boot crash when LED support is disabled
When we boot with the LED support (CONFIG_NEW_LEDS) disabled,
gpio_led_register_device() will return a NULL pointer and we try
to dereference it. Fix by checking also for a NULL pointer.
Fixes: 19a2668a8ae3 ("ARM: OMAP1: ams-delta: Provide GPIO lookup table for LED device")
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
| -rw-r--r-- | arch/arm/mach-omap1/board-ams-delta.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 1b15d593837e..b6e814166ee0 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c | |||
| @@ -749,7 +749,7 @@ static void __init ams_delta_init(void) | |||
| 749 | ARRAY_SIZE(ams_delta_gpio_tables)); | 749 | ARRAY_SIZE(ams_delta_gpio_tables)); |
| 750 | 750 | ||
| 751 | leds_pdev = gpio_led_register_device(PLATFORM_DEVID_NONE, &leds_pdata); | 751 | leds_pdev = gpio_led_register_device(PLATFORM_DEVID_NONE, &leds_pdata); |
| 752 | if (!IS_ERR(leds_pdev)) { | 752 | if (!IS_ERR_OR_NULL(leds_pdev)) { |
| 753 | leds_gpio_table.dev_id = dev_name(&leds_pdev->dev); | 753 | leds_gpio_table.dev_id = dev_name(&leds_pdev->dev); |
| 754 | gpiod_add_lookup_table(&leds_gpio_table); | 754 | gpiod_add_lookup_table(&leds_gpio_table); |
| 755 | } | 755 | } |
