]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: atomisp: Fix error handling in probe
authorEvgeny Novikov <novikov@ispras.ru>
Tue, 10 Aug 2021 16:29:43 +0000 (18:29 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 21 Aug 2021 06:29:49 +0000 (08:29 +0200)
commit66e2fcaadf8e97a4598d284dba9d8787e9ded8bd
tree0d4cb198cdab9384bc9f7e156ae26c78c33011ae
parent05344a1d2ea7bad3492c34299c37407bfcfed355
media: atomisp: Fix error handling in probe

There were several issues with handling errors in lm3554_probe():
- Probe did not set the error code when v4l2_ctrl_handler_init() failed.
- It intermixed gotos for handling errors of v4l2_ctrl_handler_init()
  and media_entity_pads_init().
- It did not set the error code for failures of v4l2_ctrl_new_custom().
- Probe did not free resources in case of failures of
  atomisp_register_i2c_module().

The patch fixes all these issues.

Found by Linux Driver Verification project (linuxtesting.org).

Link: https://lore.kernel.org/linux-media/20210810162943.19852-1-novikov@ispras.ru
Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/i2c/atomisp-lm3554.c