v4l: mx3_camera: fix NULL pointer dereference if debug output enabled
PATCH 1/1 v4l: mx3_camera: fix NULL pointer dereference if debug output enabled
Running with enabled debug output in the mx3_camera driver results in a kernel crash:
...
mx3-camera mx3-camera.0: Providing format Bayer BGGR (sRGB) 8 bit using code 11
Unable to handle kernel NULL pointer dereference at virtual address 00000004
...
Fix it by incrementing 'xlate' after usage.
--- drivers/media/video/mx3_camera.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/video/mx3_camera.c +1 -1
@@ -734,9 +734,9 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int idif (xlate) { xlate->host_fmt = fmt; xlate->code = code; - xlate++;dev_dbg (dev,"Providing format %x in pass-through mode\n" , xlate->host_fmt->fourcc); + xlate++; }return formats;
Signature · 1 line
1.7.1
Quoted 19 lines · Anatolij Gustschin
Running with enabled debug output in the
mx3_cameradriver results in a kernel crash:
...
mx3-camera mx3-camera.0: Providing format Bayer BGGR (sRGB) 8 bit using code 11Unable to handle kernel NULL pointer dereference at virtual address 00000004...
Fix it by incrementing 'xlate' after usage.
Signed-off-by Anatolij Gustschin <[email protected]>--- drivers/media/video/mx3_camera.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/media/video/mx3_camera.c +0
-0
drivers/media/video/mx3_camera.c static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id · line 739
Quoted 7 lines
drivers/media/video/mx3_camera.c +1
-1@@ -734,9 +734,9 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int idif (xlate) { xlate->host_fmt = fmt; xlate->code = code; - xlate++;dev_dbg (dev,"Providing format %x in pass-through mode\n" , xlate->host_fmt->fourcc); + xlate++;
Let's take an even easier path:
- xlate->host_fmt->fourcc);
+ fmt->fourcc);
Quoted 5 lines
drivers/media/video/mx3_camera.c +0
-0}return formats;Signature · 1 line
1.7.1
Thanks
Guennadi
---
Guennadi Liakhovetski
Quoted 31 lines · Guennadi Liakhovetski
Quoted 19 lines · Anatolij Gustschin
Running with enabled debug output in the
mx3_cameradriver results in a kernel crash:
...
mx3-camera mx3-camera.0: Providing format Bayer BGGR (sRGB) 8 bit using code 11Unable to handle kernel NULL pointer dereference at virtual address 00000004...
Fix it by incrementing 'xlate' after usage.
Signed-off-by Anatolij Gustschin <[email protected]>--- drivers/media/video/mx3_camera.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/media/video/mx3_camera.c +0
-0drivers/media/video/mx3_camera.c static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id · line 739
Quoted 7 lines
drivers/media/video/mx3_camera.c +1
-1@@ -734,9 +734,9 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int idif (xlate) { xlate->host_fmt = fmt; xlate->code = code; - xlate++;dev_dbg (dev,"Providing format %x in pass-through mode\n" , xlate->host_fmt->fourcc); + xlate++;Let's take an even easier path:
Review
Quoted 2 lines
(quoted diff) +1
-1- xlate->host_fmt->fourcc); + fmt->fourcc);
Ok, sorry, forget it - this entire patch is superseded by another one.
Guennadi
Quoted 4 lines
Quoted 4 lines
drivers/media/video/mx3_camera.c +0
-0}
Quoted 9 lines
Quoted 3 lines
drivers/media/video/mx3_camera.c +0
-0return formats;Signature · 1 line
1.7.1Thanks
Guennadi
---
Guennadi Liakhovetski
---
Guennadi Liakhovetski