[PATCH v1 13/19] intel_th: Fix dma_map_sg error check
From: Jack Wang
Date: Fri Aug 19 2022 - 02:09:34 EST
dma_map_sg return 0 on error.
Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Jack Wang <jinpu.wang@xxxxxxxxx>
---
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