From: Markus Elfring <Markus.Elfring@web.de>
To: Navid Emamdoost <navid.emamdoost@gmail.com>, netdev@vger.kernel.org
Cc: Navid Emamdoost <emamd001@umn.edu>, Kangjie Lu <kjlu@umn.edu>,
Stephen McCamant <mccamant@cs.umn.edu>,
Qiushi Wu <wu000273@umn.edu>,
"David S. Miller" <davem@davemloft.net>,
Fugang Duan <fugang.duan@nxp.com>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: fec: fix ref count leaking when pm_runtime_get_sync fails
Date: Sun, 14 Jun 2020 10:25:38 +0200 [thread overview]
Message-ID: <38dcaa5d-98ad-e1df-6e83-2e6dd677a483@web.de> (raw)
> 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?
…
> +++ b/drivers/net/ethernet/freescale/fec_main.c
…
> @@ -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
…
> @@ -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
next reply other threads:[~2020-06-14 8:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-14 8:25 Markus Elfring [this message]
2020-06-14 15:30 ` [PATCH] net: fec: fix ref count leaking when pm_runtime_get_sync fails Greg KH
-- strict thread matches above, loose matches on Subject: below --
2020-06-14 5:38 Navid Emamdoost
2020-06-15 20:42 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=38dcaa5d-98ad-e1df-6e83-2e6dd677a483@web.de \
--to=markus.elfring@web.de \
--cc=davem@davemloft.net \
--cc=emamd001@umn.edu \
--cc=fugang.duan@nxp.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=mccamant@cs.umn.edu \
--cc=navid.emamdoost@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=wu000273@umn.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).