OSDN Git Service

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)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:07:40 +0000 (10:07 +0200)
commit11b982e950d2138e90bd120501df10a439006ff8
tree0d0fe999feaa9367355f944e70da055c283e47b5
parent8dcea1d60858fbb22d563b7618d4160f9191d3d5
media: cxd2880-spi: Fix a null pointer dereference on error handling path

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>
drivers/media/spi/cxd2880-spi.c