]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: cxd2880-spi: Fix a null pointer dereference on error handling path
authorColin Ian King <colin.king@canonical.com>
Tue, 20 Jul 2021 16:07:49 +0000 (18:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 10:04:01 +0000 (11:04 +0100)
commitae0abe0db3f6600a435da0ede878fa9ab2a50f7b
tree9405182503b9c4de8b606334d462886fd3a703f2
parent195ba4c00fd0cb9183325b82c244cc1a05b32361
media: cxd2880-spi: Fix a null pointer dereference on error handling path

[ Upstream commit 11b982e950d2138e90bd120501df10a439006ff8 ]

Currently the null pointer check on dvb_spi->vcc_supply is inverted and
this leads to only null values of the dvb_spi->vcc_supply being passed
to the call of regulator_disable causing null pointer dereferences.
Fix this by only calling regulator_disable if dvb_spi->vcc_supply is
not null.

Addresses-Coverity: ("Dereference after null check")

Fixes: dcb014582101 ("media: cxd2880-spi: Fix an error handling path")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/spi/cxd2880-spi.c