summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorMaximilian Luz <luzmaximilian@gmail.com>2022-09-08 00:44:09 +0200
committerSakari Ailus <sakari.ailus@linux.intel.com>2022-10-25 10:37:02 +0300
commitdc608edf7d45ba0c2ad14c06eccd66474fec7847 (patch)
treee772bef4c32977fc5790c69ff05a4c443df1599b /include/media
parent247f34f7b80357943234f93f247a1ae6b6c3a740 (diff)
downloadlinux-dc608edf7d45ba0c2ad14c06eccd66474fec7847.tar.bz2
ipu3-imgu: Fix NULL pointer dereference in imgu_subdev_set_selection()
Calling v4l2_subdev_get_try_crop() and v4l2_subdev_get_try_compose() with a subdev state of NULL leads to a NULL pointer dereference. This can currently happen in imgu_subdev_set_selection() when the state passed in is NULL, as this method first gets pointers to both the "try" and "active" states and only then decides which to use. The same issue has been addressed for imgu_subdev_get_selection() with commit 30d03a0de650 ("ipu3-imgu: Fix NULL pointer dereference in active selection access"). However the issue still persists in imgu_subdev_set_selection(). Therefore, apply a similar fix as done in the aforementioned commit to imgu_subdev_set_selection(). To keep things a bit cleaner, introduce helper functions for "crop" and "compose" access and use them in both imgu_subdev_set_selection() and imgu_subdev_get_selection(). Fixes: 0d346d2a6f54 ("media: v4l2-subdev: add subdev-wide state struct") Cc: stable@vger.kernel.org # for v5.14 and later Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Diffstat (limited to 'include/media')
0 files changed, 0 insertions, 0 deletions