This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: ipu-bridge: Fix null pointer deref on SSDB/PLD parsing warnings
Author:  Hans de Goede <[email protected]>
Date:    Wed Jul 5 23:29:53 2023 +0200

When ipu_bridge_parse_rotation() and ipu_bridge_parse_orientation() run
sensor->adev is not set yet.

So if either of the dev_warn() calls about unknown values are hit this
will lead to a NULL pointer deref.

Set sensor->adev earlier, with a borrowed ref to avoid making unrolling
on errors harder, to fix this.

Fixes: 485aa3df0dff ("media: ipu3-cio2: Parse sensor orientation and rotation")
Cc: Fabian Wüthrich <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Reviewed-by: Daniel Scally <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/pci/intel/ipu-bridge.c | 5 +++++
 1 file changed, 5 insertions(+)

---

diff --git a/drivers/media/pci/intel/ipu-bridge.c 
b/drivers/media/pci/intel/ipu-bridge.c
index bd67c3e990ea..c23c1ee30ad9 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -308,6 +308,11 @@ static int ipu_bridge_connect_sensor(const struct 
ipu_sensor_config *cfg,
                }
 
                sensor = &bridge->sensors[bridge->n_sensors];
+               /*
+                * Borrow our adev ref to the sensor for now, on success
+                * acpi_dev_get(adev) is done further below.
+                */
+               sensor->adev = adev;
 
                ret = ipu_bridge_read_acpi_buffer(adev, "SSDB",
                                                  &sensor->ssdb,

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to