Skip to contentSkip to conversation

net: fec: fix ref count leaking when pm_runtime_get_sync fails

PATCH Markus Elfring 2 participants 2 messages Jun 14, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw
Quoted 1 line

in fec_enet_mdio_read, …

I am curious under which circumstances you would like to improve such commit messages.

* Will the tag “Fixes” become helpful?

* Which source code analysis tools did trigger to send update suggestions according to 16 similar issues for today?

…

Quoted 1 line

+++ b/drivers/net/ethernet/freescale/fec_main.c

…

Review static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum, · line 1903

Quoted 11 lines
(quoted diff) +3 -1
@@ -1893,8 +1895,10 @@  static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
 	bool is_c45 = !!(regnum & MII_ADDR_C45);
 
 	ret = pm_runtime_get_sync(dev);
-	if (ret < 0)
+	if (ret < 0) {
+		pm_runtime_put_autosuspend(dev);
 		return ret;
+	}
 	else
 		ret = 0;

I suggest to adjust also the source code from the else branch.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=96144c58abe7ff767e754b5b80995f7b8846d49b#n196

…

Review static void fec_enet_get_regs(struct net_device *ndev, · line 2285

Quoted 7 lines
(quoted diff) +1 -0
@@ -2276,6 +2280,7 @@  static void fec_enet_get_regs(struct net_device *ndev,
 	}
 
 	pm_runtime_mark_last_busy(dev);
+out:
 	pm_runtime_put_autosuspend(dev);
 }

Perhaps use the label “put_runtime” instead?

Regards,
Markus

#1 lore raw
Quoted 10 lines · Markus Elfring
Quoted 1 line

in fec_enet_mdio_read, …

I am curious under which circumstances you would like to improve such commit messages.

* Will the tag “Fixes” become helpful?

* Which source code analysis tools did trigger to send update suggestions according to 16 similar issues for today?

Hi,

This is the semi-friendly patch-bot of Greg Kroah-Hartman.

Markus, you seem to have sent a nonsensical or otherwise pointless review comment to a patch submission on a Linux kernel developer mailing list. I strongly suggest that you not do this anymore. Please do not bother developers who are actively working to produce patches and features with comments that, in the end, are a waste of time.

Patch submitter, please ignore Markus's suggestion; you do not need to follow it at all. The person/bot/AI that sent it is being ignored by almost all Linux kernel maintainers for having a persistent pattern of behavior of producing distracting and pointless commentary, and inability to adapt to feedback. Please feel free to also ignore emails from them.

thanks,

greg k-h's patch email bot