linux-uconsole/drivers/media/platform/davinci
Wenwen Wang 1adde6589b media: isif: fix a NULL pointer dereference bug
[ Upstream commit a26ac6c1be ]

In isif_probe(), there is a while loop to get the ISIF base address and
linearization table0 and table1 address. In the loop body, the function
platform_get_resource() is called to get the resource. If
platform_get_resource() returns NULL, the loop is terminated and the
execution goes to 'fail_nobase_res'. Suppose the loop is terminated at the
first iteration because platform_get_resource() returns NULL and the
execution goes to 'fail_nobase_res'. Given that there is another while loop
at 'fail_nobase_res' and i equals to 0, one iteration of the second while
loop will be executed. However, the second while loop does not check the
return value of platform_get_resource(). This can cause a NULL pointer
dereference bug if the return value is a NULL pointer.

This patch avoids the above issue by adding a check in the second while
loop after the call to platform_get_resource().

Signed-off-by: Wenwen Wang <wang6495@umn.edu>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-11-24 08:20:47 +01:00
..
ccdc_hw_device.h
dm355_ccdc.c media: fix usage of whitespaces and on indentation 2018-01-04 13:12:01 -05:00
dm355_ccdc_regs.h media: replace all <spaces><tab> occurrences 2018-01-04 13:15:05 -05:00
dm644x_ccdc.c media: fix usage of whitespaces and on indentation 2018-01-04 13:12:01 -05:00
dm644x_ccdc_regs.h media: replace all <spaces><tab> occurrences 2018-01-04 13:15:05 -05:00
isif.c media: isif: fix a NULL pointer dereference bug 2019-11-24 08:20:47 +01:00
isif_regs.h media: replace all <spaces><tab> occurrences 2018-01-04 13:15:05 -05:00
Kconfig media: Remove depends on HAS_DMA in case of platform dependency 2018-05-28 16:17:08 -04:00
Makefile
vpbe.c media: DaVinci-VPBE: fix error handling in vpbe_initialize() 2019-02-12 19:47:04 +01:00
vpbe_display.c media: davinci: Fix implicit enum conversion warning 2019-11-20 18:47:17 +01:00
vpbe_osd.c media: headers: fix linux/mod_devicetable.h inclusions 2018-08-02 18:30:54 -04:00
vpbe_osd_regs.h
vpbe_venc.c media: headers: fix linux/mod_devicetable.h inclusions 2018-08-02 18:30:54 -04:00
vpbe_venc_regs.h
vpfe_capture.c media: davinci: don't override the error code 2018-05-04 08:59:37 -04:00
vpif.c
vpif.h media: replace all <spaces><tab> occurrences 2018-01-04 13:15:05 -05:00
vpif_capture.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
vpif_capture.h
vpif_display.c media: davinci: vpif_display: Mix memory leak on probe error path 2018-08-02 19:14:25 -04:00
vpif_display.h
vpss.c media: vpss: fix a potential NULL pointer dereference 2019-07-26 09:14:00 +02:00