From: Alessandro Zanni <alessandro.zanni87@gmail.com>
To: robin.murphy@arm.com, joro@8bytes.org, will@kernel.org
Cc: Alessandro Zanni <alessandro.zanni87@gmail.com>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
skhan@linuxfoundation.org, anupnewsmail@gmail.com
Subject: [PATCH] iommu/dma: Potential uninitialized variable in iommu_dma_unmap_sg
Date: Wed, 2 Oct 2024 10:31:28 +0200 [thread overview]
Message-ID: <20241002083131.18135-1-alessandro.zanni87@gmail.com> (raw)
This patch fix the possibility to have the variable 'start'
not initialized.
Smatch tool raises the error:
drivers/iommu/dma-iommu.c:1510
iommu_dma_unmap_sg() error: uninitialized symbol 'start'.
Signed-off-by: Alessandro Zanni <alessandro.zanni87@gmail.com>
---
drivers/iommu/dma-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index 2a9fa0c8cc00..5b2596f4b24f 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -1496,7 +1496,7 @@ int iommu_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
void iommu_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
enum dma_data_direction dir, unsigned long attrs)
{
- dma_addr_t end = 0, start;
+ dma_addr_t end = 0, start = 0;
struct scatterlist *tmp;
int i;
--
2.43.0
next reply other threads:[~2024-10-02 8:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 8:31 Alessandro Zanni [this message]
2024-10-02 9:45 ` [PATCH] iommu/dma: Potential uninitialized variable in iommu_dma_unmap_sg Robin Murphy
2024-10-02 13:08 ` Alessandro Zanni
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=20241002083131.18135-1-alessandro.zanni87@gmail.com \
--to=alessandro.zanni87@gmail.com \
--cc=anupnewsmail@gmail.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=skhan@linuxfoundation.org \
--cc=will@kernel.org \
/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