linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin King <colin.king@canonical.com>
To: Barry Song <song.bao.hua@hisilicon.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	iommu@lists.linux-foundation.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment
Date: Wed, 25 Nov 2020 13:55:35 +0000	[thread overview]
Message-ID: <20201125135535.1880307-1-colin.king@canonical.com> (raw)

From: Colin Ian King <colin.king@canonical.com>

The assignment of argp is currently using argp as the source because of
a typo. Fix this by assigning it the value passed in arg instead.

Addresses-Coverity: ("Uninitialized pointer read")
Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming DMA APIs")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 kernel/dma/map_benchmark.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
index ca616b664f72..e1e37603d01b 100644
--- a/kernel/dma/map_benchmark.c
+++ b/kernel/dma/map_benchmark.c
@@ -192,7 +192,7 @@ static long map_benchmark_ioctl(struct file *file, unsigned int cmd,
 		unsigned long arg)
 {
 	struct map_benchmark_data *map = file->private_data;
-	void __user *argp = (void __user *)argp;
+	void __user *argp = (void __user *)arg;
 	u64 old_dma_mask;
 
 	int ret;
-- 
2.29.2


             reply	other threads:[~2020-11-25 13:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 13:55 Colin King [this message]
2020-11-25 18:22 ` [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment Song Bao Hua (Barry Song)
2020-11-25 18:29   ` Christoph Hellwig

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=20201125135535.1880307-1-colin.king@canonical.com \
    --to=colin.king@canonical.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    --cc=song.bao.hua@hisilicon.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 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).