diff options
author | Zheyu Ma <zheyuma97@gmail.com> | 2022-04-14 03:34:35 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-09 10:29:36 +0200 |
commit | fa83ea1de5b3efd87fe01408d5db1fd2ff4767fa (patch) | |
tree | 8ef69f65f937a729d2af2502cd3f1b7a95410278 /drivers/media/i2c | |
parent | 86a3853e79de038232e57898150b9c1dedfafee6 (diff) | |
download | linux-stable-fa83ea1de5b3efd87fe01408d5db1fd2ff4767fa.tar.gz |
media: i2c: dw9714: Disable the regulator when the driver fails to probe
[ Upstream commit 02276e18defa2fccf16413b44440277d98c2b1ea ]
When the driver fails to probe, we will get the following splat:
[ 59.305988] ------------[ cut here ]------------
[ 59.306417] WARNING: CPU: 2 PID: 395 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0
[ 59.310345] RIP: 0010:_regulator_put+0x3ec/0x4e0
[ 59.318362] Call Trace:
[ 59.318582] <TASK>
[ 59.318765] regulator_put+0x1f/0x30
[ 59.319058] devres_release_group+0x319/0x3d0
[ 59.319420] i2c_device_probe+0x766/0x940
Fix this by disabling the regulator in error handling.
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/dw9714.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/i2c/dw9714.c b/drivers/media/i2c/dw9714.c index cd7008ad8f2f..8c5797ba57d4 100644 --- a/drivers/media/i2c/dw9714.c +++ b/drivers/media/i2c/dw9714.c @@ -183,6 +183,7 @@ static int dw9714_probe(struct i2c_client *client) return 0; err_cleanup: + regulator_disable(dw9714_dev->vcc); v4l2_ctrl_handler_free(&dw9714_dev->ctrls_vcm); media_entity_cleanup(&dw9714_dev->sd.entity); |