• Johan Hovold's avatar
    leds: lm3533: fix use-after-free on unbind · d584221e
    Johan Hovold authored
    Several MFD child drivers register their class devices directly under
    the parent device. This means you cannot blindly do devres conversions
    so that deregistration ends up being tied to the parent device,
    something which leads to use-after-free on driver unbind when the class
    device is released while still being registered.
    
    Fixes: 50154e29 ("leds: lm3533: Use devm_led_classdev_register")
    Cc: stable <stable@vger.kernel.org>     # 4.6
    Cc: Amitoj Kaur Chawla <amitoj1606@gmail.com>
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
    d584221e
leds-lm3533.c 17.5 KB