lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 14 Jun 2020 10:25:38 +0200
From:   Markus Elfring <Markus.Elfring@....de>
To:     Navid Emamdoost <navid.emamdoost@...il.com>, netdev@...r.kernel.org
Cc:     Navid Emamdoost <emamd001@....edu>, Kangjie Lu <kjlu@....edu>,
        Stephen McCamant <mccamant@...umn.edu>,
        Qiushi Wu <wu000273@....edu>,
        "David S. Miller" <davem@...emloft.net>,
        Fugang Duan <fugang.duan@....com>,
        kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: fec: fix ref count leaking when pm_runtime_get_sync
 fails

> 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

Powered by blists - more mailing lists