]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
spi: img-spfi: fix potential double release
authorPan Bian <bianpan2016@163.com>
Wed, 6 Nov 2019 02:36:09 +0000 (10:36 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:58:30 +0000 (23:58 -0500)
commit173ff0d57492e3e87eca358f59a7da3bc373f95f
tree874f2215dd128d805ebd60afd9f489dd6229aed8
parent442075ec5c6c9f3e8db6343f4ff29253fb4d134c
spi: img-spfi: fix potential double release

BugLink: https://bugs.launchpad.net/bugs/1860490
[ Upstream commit e9a8ba9769a0e354341bc6cc01b98aadcea1dfe9 ]

The channels spfi->tx_ch and spfi->rx_ch are not set to NULL after they
are released. As a result, they will be released again, either on the
error handling branch in the same function or in the corresponding
remove function, i.e. img_spfi_remove(). This patch fixes the bug by
setting the two members to NULL.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Link: https://lore.kernel.org/r/1573007769-20131-1-git-send-email-bianpan2016@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/spi/spi-img-spfi.c