Files
linux/drivers
Wenwen Wang e5a40e6f5c 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>
2023-05-15 15:12:31 +09:00
..
2023-05-12 16:27:16 +09:00
2023-05-15 15:12:14 +09:00
2023-05-15 10:39:04 +09:00
2023-05-15 12:46:28 +09:00
2018-05-25 17:06:35 +02:00
2023-05-15 14:57:41 +09:00
2023-05-15 10:37:00 +09:00
2023-05-15 09:23:01 +09:00
2023-05-15 09:51:46 +09:00
2023-05-15 08:28:33 +09:00
2023-05-15 14:29:17 +09:00
2023-05-15 13:00:07 +09:00
2023-05-15 14:47:51 +09:00