Files
linux/drivers
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
..
2019-11-24 08:20:31 +01:00
2019-05-14 19:17:53 +02:00
2019-10-05 13:09:45 +02:00
2019-11-12 19:20:30 +01:00
2019-11-20 18:47:35 +01:00
2019-07-26 09:14:05 +02:00
2019-11-20 18:47:52 +01:00
2019-09-16 08:22:25 +02:00
2019-05-31 06:46:14 -07:00
2019-10-11 18:21:13 +02:00