Skip to contentSkip to conversation

staging: android/ion: testing the wrong variable

PATCH In review Dan Carpenter 2 participants 2 messages Oct 12, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: android/ion: testing the wrong variable

We're testing "pdev" but we intended to test "heap_pdev". This is a static checker fix and it's unlikely that anyone is affected by this bug.

Fixes 13439479c7de ('staging: ion: Add files for parsing the devicetree')
drivers/staging/android/ion/ion_of.c +1 -1
index 15bac92..46b2bb9 100644
@@ -107,7 +107,7 @@ struct ion_platform_data *ion_parse_dt(struct platform_device *pdev,
 
 		heap_pdev = of_platform_device_create(node, heaps[i].name,
 						      &pdev->dev);
-		if (!pdev)
+		if (!heap_pdev)
 			return ERR_PTR(-ENOMEM);
 		heap_pdev->dev.platform_data = &heaps[i];
 
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dan Carpenter

We're testing "pdev" but we intended to test "heap_pdev". This is a static checker fix and it's unlikely that anyone is affected by this bug.

Fixes 13439479c7de ('staging: ion: Add files for parsing the devicetree')
Quoted 14 lines
drivers/staging/android/ion/ion_of.c +1 -1
index 15bac92..46b2bb9 100644
@@ -107,7 +107,7 @@ struct ion_platform_data *ion_parse_dt(struct platform_device *pdev,
 
 		heap_pdev = of_platform_device_create(node, heaps[i].name,
 						      &pdev->dev);
-		if (!pdev)
+		if (!heap_pdev)
 			return ERR_PTR(-ENOMEM);
 		heap_pdev->dev.platform_data = &heaps[i];