Skip to contentSkip to conversation

intel_th: Fix dma_map_sg error check

PATCH Superseded Jack Wang 2 participants 3 messages Aug 26, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jack Wang

author
#0 lore raw

PATCH 1/1 intel_th: Fix dma_map_sg error check

dma_map_sg return 0 on error.

Cc Alexander Shishkin <[email protected]>
Fixes 4e0eaf239fb3 ("intel_th: msu: Fix single mode with IOMMU")
---
 drivers/hwtracing/intel_th/msu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/intel_th/msu.c +1 -1
index 6c8215a47a60..b49237d56a60 100644
@@ -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;
Signature · 1 line
2.34.1
#1 lore raw

Le 26/08/2022 à 12:15, Jack Wang a écrit :

Quoted 15 lines

dma_map_sg return 0 on error.

Cc Alexander Shishkin <[email protected]>
Fixes 4e0eaf239fb3 ("intel_th: msu: Fix single mode with IOMMU")
---
  drivers/hwtracing/intel_th/msu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/intel_th/msu.c +0 -0
index 6c8215a47a60..b49237d56a60 100644

drivers/hwtracing/intel_th/msu.c static int msc_buffer_contig_alloc(struct msc *msc, unsigned long size) · line 934

Quoted 5 lines
drivers/hwtracing/intel_th/msu.c +1 -1
@@ -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)

Missing ret = -EIO?
like in other patches?

CJ

Quoted 3 lines
drivers/hwtracing/intel_th/msu.c +0 -0
  		goto err_free_pages;
 
  	msc->nr_pages = nr_pages;
author
#2 lore raw
Quoted 18 lines · Christophe JAILLET
Quoted 16 lines · Jack Wang

dma_map_sg return 0 on error.

Cc Alexander Shishkin <[email protected]>
Fixes 4e0eaf239fb3 ("intel_th: msu: Fix single mode with IOMMU")
---
  drivers/hwtracing/intel_th/msu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/intel_th/msu.c +0 -0
index 6c8215a47a60..b49237d56a60 100644
@@ -931,7 +931,7 @@ static int msc_buffer_contig_alloc(struct msc *msc, unsigned long size)
 
Quoted 7 lines

drivers/hwtracing/intel_th/msu.c static int msc_buffer_contig_alloc(struct msc *msc, unsigned long size) · line 934

Quoted 4 lines
drivers/hwtracing/intel_th/msu.c +1 -1
      ret = dma_map_sg(msc_dev(msc)->parent->parent, msc->single_sgt.sgl, 1,
                       DMA_FROM_DEVICE);
-     if (ret < 0)
+     if (!ret)

Missing ret = -EIO?
like in other patches?

oh, right, thx for catching it.
sent v2 patch.

Quoted 7 lines

CJ

Quoted 3 lines
drivers/hwtracing/intel_th/msu.c +0 -0
              goto err_free_pages;
 
      msc->nr_pages = nr_pages;