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: <2ba308ae-4aba-46ff-8187-ba9a69a26e4c@gmx.net>
Date: Sun, 13 Oct 2024 15:03:34 +0200
From: Hans-Frieder Vogt <hfdevel@....net>
To: daniel@...rotopia.org
Cc: andrew@...n.ch, ansuelsmth@...il.com, bartosz.golaszewski@...aro.org,
 davem@...emloft.net, edumazet@...gle.com, hkallweit1@...il.com,
 kuba@...nel.org, linux-kernel@...r.kernel.org, linux@...linux.org.uk,
 netdev@...r.kernel.org, pabeni@...hat.com, quic_abchauha@...cinc.com,
 robimarko@...il.com
Subject: Re: [PATCH net-next] net: phy: aquantia: fix return value check in
 aqr107_config_mdi()

On Fri, 11 Oct 2024 22:33:52 +0100, Daniel Golle wrote:
> of_property_read_u32() returns -EINVAL in case the property cannot be
> found rather than -ENOENT. Fix the check to not abort probing in case
> of the property being missing.
there is another failure case, which is not properly covered:
if the system is non-device-tree, the function of_property_read_u32 returns -ENOSYS.
While you are correcting the return value, you may also correct this case.
>
> Fixes: a2e1ba275eae ("net: phy: aquantia: allow forcing order of MDI pairs")
> Reported-by: Jon Hunter <jonathanh@...dia.com>
> Closes: https://lore.kernel.org/all/114b4c03-5d16-42ed-945d-cf78eabea12b@nvidia.com/
> Signed-off-by: Daniel Golle <daniel@...rotopia.org>
> ---
>   drivers/net/phy/aquantia/aquantia_main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/aquantia/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c
> index 4fe757cd7dc7..49fd21d1b3c9 100644
> --- a/drivers/net/phy/aquantia/aquantia_main.c
> +++ b/drivers/net/phy/aquantia/aquantia_main.c
> @@ -513,7 +513,7 @@ static int aqr107_config_mdi(struct phy_device *phydev)
>   	ret = of_property_read_u32(np, "marvell,mdi-cfg-order", &mdi_conf);
>
>   	/* Do nothing in case property "marvell,mdi-cfg-order" is not present */
> -	if (ret == -ENOENT)
> +	if (ret == -EINVAL)
the non-device-tree case could be simply covered by this:
	if (ret == -EINVAL || ret == -ENOSYS)
>   		return 0;
>
>   	if (ret)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ