From: Jack Wang <jinpu.wang@ionos.com>
To: alexander.shishkin@linux.intel.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] intel_th: Fix dma_map_sg error check
Date: Fri, 26 Aug 2022 12:15:23 +0200 [thread overview]
Message-ID: <20220826101523.79502-1-jinpu.wang@ionos.com> (raw)
dma_map_sg return 0 on error.
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Fixes: 4e0eaf239fb3 ("intel_th: msu: Fix single mode with IOMMU")
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
---
drivers/hwtracing/intel_th/msu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index 6c8215a47a60..b49237d56a60 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -931,7 +931,7 @@ static int msc_buffer_contig_alloc(struct msc *msc, unsigned long size)
ret = dma_map_sg(msc_dev(msc)->parent->parent, msc->single_sgt.sgl, 1,
DMA_FROM_DEVICE);
- if (ret < 0)
+ if (!ret)
goto err_free_pages;
msc->nr_pages = nr_pages;
--
2.34.1
next reply other threads:[~2022-08-26 10:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 10:15 Jack Wang [this message]
2022-08-26 10:31 ` Christophe JAILLET
2022-08-26 10:39 ` Jinpu Wang
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=20220826101523.79502-1-jinpu.wang@ionos.com \
--to=jinpu.wang@ionos.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®