]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
memstick: fix a double-free bug in memstick_check
authorQinglang Miao <miaoqinglang@huawei.com>
Fri, 20 Nov 2020 07:48:46 +0000 (15:48 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Jan 2021 13:25:47 +0000 (14:25 +0100)
commitb996c9de1ade77e3fb3815cb1bc6c8664fadcc6e
treef41183ae999474767d570a688d489ba10c1a924c
parentbe6f23fbadacb871cb09e8bb6600d981c7ebb618
memstick: fix a double-free bug in memstick_check

BugLink: https://bugs.launchpad.net/bugs/1910822
[ Upstream commit e3e9ced5c93803d5b2ea1942c4bf0192622531d6 ]

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 <hulkci@huawei.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Link: https://lore.kernel.org/r/20201120074846.31322-1-miaoqinglang@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/memstick/core/memstick.c