media: atomisp: Fix a pointer math problem in dump_sp_dmem()
Subsystems (5)
Media (V4L/DVB) Staging Kernel janitors Intel MID (Mobile Internet Device) platform +1 more subsystems
PATCH 1/1 media: atomisp: Fix a pointer math problem in dump_sp_dmem()
The "io_virt_addr" variable is a u32 pointer and it should be incremented by one instead of four. The current code will dump bogus data and read beyond the end of the buffer.
Fixes 69a03e36c711 ("media: atomisp: get rid of an iomem abstraction layer")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/staging/media/atomisp/pci/atomisp_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp_cmd.c +1 -1
@@ -682,7 +682,7 @@ void dump_sp_dmem(struct atomisp_device *isp, unsigned int addr,do { data = *io_virt_addr;dev_dbg (isp->dev,"%s, \t [0x%x]:0x%x\n" , __func__, addr, data); - io_virt_addr +=sizeof (u32); + io_virt_addr++; size32 -=1 ; }while (size32 >0 ); }
Signature · 1 line
2.27.0
Quoted 6 lines · Dan Carpenter
The "
io_virt_addr" variable is a u32 pointer and it should be incremented by one instead of four. The current code will dump bogus data and read beyond the end of the buffer.Fixes 69a03e36c711 ("media: atomisp: get rid of an iomem abstraction layer")Signed-off-by Dan Carpenter <[email protected]>
Acked-by Sakari Ailus <[email protected]>
Signature · 1 line
Sakari Ailus