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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a34e1f1038e667e0ee9a568e7b8ff3ce@codeaurora.org>
Date:   Mon, 19 Mar 2018 14:17:22 +0530
From:   Vivek Gautam <vivek.gautam@...eaurora.org>
To:     Manu Gautam <mgautam@...eaurora.org>
Cc:     Kishon Vijay Abraham I <kishon@...com>,
        linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm-owner@...r.kernel.org
Subject: Re: [PATCH] phy: core: Allow phy_pm_runtime_xxx API calls with NULL
 phy

On 2018-03-16 14:40, Manu Gautam wrote:
> phy_init() and phy_exit() calls, and phy_power_on() and
> phy_power_off() already accept NULL as valid PHY refernece
> and act as NOP. Extend same concept to phy runtime_pm APIs
> to keep drivers (e.g. dwc3) code simple while dealing with
> optional PHYs.
> 
> Signed-off-by: Manu Gautam <mgautam@...eaurora.org>
> ---
>  drivers/phy/phy-core.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index 09ac8af..48b9615 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -153,6 +153,9 @@ int phy_pm_runtime_get(struct phy *phy)
>  {
>  	int ret;
> 
> +	if (!phy)
> +		return 0;
> +
>  	if (!pm_runtime_enabled(&phy->dev))

Were we already trying to dereference a NULL here?
That shouldn't be good i guess.
Kishon, do we not expect phys to be NULL here?

<snip>

regards
Vivek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ