archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <>
To: Mauro Carvalho Chehab <>
	Sakari Ailus <>,
Subject: [PATCH] media: atomisp: Fix a pointer math problem in dump_sp_dmem()
Date: Tue, 16 Jun 2020 09:27:28 +0000	[thread overview]
Message-ID: <20200616092728.GB11940@mwanda> (raw)

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 <>
 drivers/staging/media/atomisp/pci/atomisp_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
index 7b936e5a5f03..6faf223c6d20 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
@@ -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);

             reply	other threads:[~2020-06-16  9:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16  9:27 Dan Carpenter [this message]
2020-06-16  9:51 ` [PATCH] media: atomisp: Fix a pointer math problem in dump_sp_dmem() Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200616092728.GB11940@mwanda \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).