]> git.baikalelectronics.ru Git - kernel.git/commit
media: ipu3-imgu: Fix NULL pointer dereference in active selection access
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 25 Aug 2022 18:36:37 +0000 (20:36 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 24 Sep 2022 07:04:32 +0000 (09:04 +0200)
commiteca3e63cce00409e020abe1dd4b17754c7cd518d
treef76f3c69df3ffbad49e63726011a3676815bdd3d
parent8e1ed0339320afa6fb78f5daff036ed9655eee3c
media: ipu3-imgu: Fix NULL pointer dereference in active selection access

What the IMGU driver did was that it first acquired the pointers to active
and try V4L2 subdev state, and only then figured out which one to use.

The problem with that approach and a later patch (see Fixes: tag) is that
as sd_state argument to v4l2_subdev_get_try_crop() et al is NULL, there is
now an attempt to dereference that.

Fix this.

Also rewrap lines a little.

Fixes: 24a5881203e5 ("media: v4l2-subdev: add subdev-wide state struct")
Cc: stable@vger.kernel.org # for v5.14 and later
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/ipu3/ipu3-v4l2.c