memstick: fix a double-free bug in memstick_check
Subsystems (2)
PATCH 1/1 memstick: fix a double-free bug in memstick_check
kfree(host->card) has been called in put_device so that another kfree would raise cause a double-free bug.
Fixes 0193383a5833 ("memstick: core: fix device_register() error handling")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Qinglang Miao <[email protected]>
--- drivers/memstick/core/memstick.c | 1 - 1 file changed, 1 deletion(-)
drivers/memstick/core/memstick.c +0 -1
@@ -468,7 +468,6 @@ static void memstick_check(struct work_struct *work) host->card = card;if (device_register (&card->dev)) {put_device (&card->dev); -kfree (host->card); host->card =NULL ; } }else
Signature · 1 line
2.23.0
Quoted 7 lines · Qinglang Miao
kfree(host->card)has been called input_deviceso that another kfree would raise cause a double-free bug.Fixes 0193383a5833 ("memstick: core: fix device_register() error handling")Reported-by Hulk Robot <[email protected]>Signed-off-by Qinglang Miao <[email protected]>
Applied for next, thanks!
Kind regards
Uffe
Quoted 19 lines
--- drivers/memstick/core/memstick.c | 1 - 1 file changed, 1 deletion(-)drivers/memstick/core/memstick.c +0
-2@@ -468,7 +468,6 @@ static void memstick_check(struct work_struct *work) host->card = card;if (device_register (&card->dev)) {put_device (&card->dev); -kfree (host->card); host->card =NULL ; } }else --2.23.0