Skip to contentSkip to conversation

media: intel/ipu6: Fix a null pointer dereference in ipu6_isys_query_stream_by_source

PATCH Applied Hao Ge 2 participants 2 messages Jun 7, 2024

Subsystems (2)
lore
Share & tools
lore

Hao Ge

author
#0 lore raw

PATCH 1/1 media: intel/ipu6: Fix a null pointer dereference in ipu6_isys_query_stream_by_source

From: Hao Ge <[email protected]>

stream is NULL when source is less than 0 in
ipu6_isys_query_stream_by_source. It's a null
pointer dereference.

Actually, this should be isys->adev->auxdev.dev.

Fixes 3c1dfb5a69cf ("media: intel/ipu6: input system video nodes and buffer queues")
---
 drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +1 -1
index c8a33e1e910c..06090cc0a476 100644
@@ -943,7 +943,7 @@ ipu6_isys_query_stream_by_source(struct ipu6_isys *isys, int source, u8 vc)
 		return NULL;
 
 	if (source < 0) {
-		dev_err(&stream->isys->adev->auxdev.dev,
+		dev_err(&isys->adev->auxdev.dev,
 			"query stream with invalid port number\n");
 		return NULL;
 	}
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw

Hi Hao,

Thanks for the patch.

Quoted 5 lines · Hao Ge

From: Hao Ge <[email protected]>

stream is NULL when source is less than 0 in
ipu6_isys_query_stream_by_source. It's a null
pointer dereference.

Applied. Rewrapped this, lines can be up to 75 characters long.

Quoted 22 lines

Actually, this should be isys->adev->auxdev.dev.

Fixes 3c1dfb5a69cf ("media: intel/ipu6: input system video nodes and buffer queues")
---
 drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +1 -1
index c8a33e1e910c..06090cc0a476 100644
@@ -943,7 +943,7 @@ ipu6_isys_query_stream_by_source(struct ipu6_isys *isys, int source, u8 vc)
 		return NULL;
 
 	if (source < 0) {
-		dev_err(&stream->isys->adev->auxdev.dev,
+		dev_err(&isys->adev->auxdev.dev,
 			"query stream with invalid port number\n");
 		return NULL;
 	}
Signature · 3 lines
Regards,

Sakari Ailus