Re: [PATCH v2] p54: don't unregister leds when they are not initialized

From: Christian Lamparter
Date: Tue Sep 26 2017 - 12:53:45 EST


On Tuesday, September 26, 2017 5:11:33 PM CEST Andrey Konovalov wrote:
> ieee80211_register_hw() in p54_register_common() may fail and leds won't
> get initialized. Currently p54_unregister_common() doesn't check that and
> always calls p54_unregister_leds(). The fix is to check priv->registered
> flag before calling p54_unregister_leds().
>
> Found by syzkaller.
>
> [...]
> process_scheduled_works kernel/workqueue.c:2179
> worker_thread+0xb2b/0x1850 kernel/workqueue.c:2255
> kthread+0x3a1/0x470 kernel/kthread.c:231
> ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431
>
> Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Acked-by: Christian Lamparter <chunkeey@xxxxxxxxxxxxxx>

Thanks for making the patch too!