Files
linux-nv-oot/drivers/media/i2c/nv_imx477.c
Jon Hunter 24acf38e0b media: camera: Fix crash in sensor drivers
When CONFIG_V4L2_ASYNC is not enabled and CONFIG_DEBUG_LIST is enabled
then the following kernel panic is observed ...

 imx219: probe of 9-0010 failed with error -524
 list_add corruption. next->prev should be prev (ffffb2b2e95dad78),
  but was 0000000000000000. (next=ffff000088baf508).
 ------------[ cut here ]------------
 kernel BUG at lib/list_debug.c:23!
 Internal error: Oops - BUG: 00000000f2000800 [#1] SMP

If CONFIG_V4L2_ASYNC is not enabled in the kernel, then the function
tegracam_v4l2subdev_register() will return -ENOTSUPP and this will cause
the probe of the sensor drivers to fail. Although failing to probe the
driver is expected in this case, it is not expected that this will
trigger a kernel panic if CONFIG_DEBUG_LIST is enabled. The panic is
caused because tegracam_device_unregister() is not being called in the
exit path of the probe function when tegracam_v4l2subdev_register()
returns an error.

Bug 4704110

Change-Id: I4875a31e55c24b5ab0932a683f16a7a74695a6b6
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3162389
(cherry picked from commit 118cd4e0a6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3173737
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-07-14 05:22:05 -07:00

20 KiB