diff mbox series

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

Message ID 20240607082542.380166-1-hao.ge@linux.dev (mailing list archive)
State New
Headers show
Series media: intel/ipu6: Fix a null pointer dereference in ipu6_isys_query_stream_by_source | expand

Commit Message

Hao Ge June 7, 2024, 8:25 a.m. UTC
From: Hao Ge <gehao@kylinos.cn>

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")
Signed-off-by: Hao Ge <gehao@kylinos.cn>
---
 drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sakari Ailus June 7, 2024, 9:27 a.m. UTC | #1
Hi Hao,

Thanks for the patch.

On Fri, Jun 07, 2024 at 04:25:42PM +0800, Hao Ge wrote:
> From: Hao Ge <gehao@kylinos.cn>
> 
> 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.

> 
> Actually, this should be isys->adev->auxdev.dev.
> 
> Fixes: 3c1dfb5a69cf ("media: intel/ipu6: input system video nodes and buffer queues")
> Signed-off-by: Hao Ge <gehao@kylinos.cn>
> ---
>  drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> index c8a33e1e910c..06090cc0a476 100644
> --- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> @@ -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;
>  	}
diff mbox series

Patch

diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
index c8a33e1e910c..06090cc0a476 100644
--- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
+++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
@@ -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;
 	}