Skip to contentSkip to conversation

mmc: sdhci-xenon: fix device_node_continue.cocci warnings

PATCH New Julia Lawall 2 participants 2 messages Dec 9, 2016 – Dec 12, 2016

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

PATCH 1/1 mmc: sdhci-xenon: fix device_node_continue.cocci warnings

Device node iterators put the previous value of the index variable, so an explicit put causes a double put.

Generated by: scripts/coccinelle/iterators/device_node_continue.cocci

---

Please check on this. I have only seen the code shown below, but the rule normally has a lot false positive rate.

url:
https://github.com/0day-ci/linux/commits/Gregory-CLEMENT/mmc-Add-support-to-Marvell-Xenon-SD-Host-Controller/20161210-002602
base:
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

Please take the patch only if it's a positive warning. Thanks!

 sdhci-xenon.c |    1 -
 1 file changed, 1 deletion(-)
drivers/mmc/host/sdhci-xenon.c +0 -1
@@ -423,7 +423,6 @@ static int xenon_child_node_of_parse(str
 				      MMC_CAP2_NO_SD |
 				      MMC_CAP2_NO_SDIO;
 		}
-		of_node_put(child);
 	}
 
 	return 0;
maintainer
#1 lore raw

PATCH 1/1 mmc: sdhci-xenon: fix device_node_continue.cocci warnings

Hi Julia,

Quoted 5 lines · Julia Lawall

Device node iterators put the previous value of the index variable, so an explicit put causes a double put.

Generated by: scripts/coccinelle/iterators/device_node_continue.cocci

Quoted 8 lines

---

Please check on this. I have only seen the code shown below, but the rule normally has a lot false positive rate.

Thank you.
It seems that the check is right. I will correct it.

Thank you.

Best regards,
Hu Ziji

Quoted 23 lines

url:
https://github.com/0day-ci/linux/commits/Gregory-CLEMENT/mmc-Add-support-to-Marvell-Xenon-SD-Host-Controller/20161210-002602
base:
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

Please take the patch only if it's a positive warning. Thanks!

 sdhci-xenon.c |    1 -
 1 file changed, 1 deletion(-)
drivers/mmc/host/sdhci-xenon.c +0 -1
@@ -423,7 +423,6 @@ static int xenon_child_node_of_parse(str
 				      MMC_CAP2_NO_SD |
 				      MMC_CAP2_NO_SDIO;
 		}
-		of_node_put(child);
 	}
 
 	return 0;