All of lore.kernel.org
 help / color / mirror / Atom feed
From: Moritz Fischer <mdf@kernel.org>
To: linux-fpga@vger.kernel.org
Cc: jgg@ziepe.ca, yilun.xu@intel.com, hao.wu@intel.com,
	Moritz Fischer <mdf@kernel.org>
Subject: [PATCH] fpga: fpga-mgr: Fix undefined behavior
Date: Thu, 21 Apr 2022 07:39:24 -0700	[thread overview]
Message-ID: <20220421143924.68443-1-mdf@kernel.org> (raw)

Incrementing void pointers is undefined behavior.

Fixes: baa6d3966351 ("fpga: Add scatterlist based programming")
Signed-off-by: Moritz Fischer <mdf@kernel.org>
---
 drivers/fpga/fpga-mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
index 6bd018f20793..3d9b8722f5ce 100644
--- a/drivers/fpga/fpga-mgr.c
+++ b/drivers/fpga/fpga-mgr.c
@@ -299,7 +299,7 @@ static int fpga_mgr_buf_load(struct fpga_manager *mgr,
 {
 	struct page **pages;
 	struct sg_table sgt;
-	const void *p;
+	const char *p;
 	int nr_pages;
 	int index;
 	int rc;
-- 
2.36.0


             reply	other threads:[~2022-04-21 14:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 14:39 Moritz Fischer [this message]
2022-04-21 14:57 ` [PATCH] fpga: fpga-mgr: Fix undefined behavior Jason Gunthorpe

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20220421143924.68443-1-mdf@kernel.org \
    --to=mdf@kernel.org \
    --cc=hao.wu@intel.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-fpga@vger.kernel.org \
    --cc=yilun.xu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.