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]
Date:   Wed, 2 Nov 2022 18:12:07 +0100
From:   Horatiu Vultur <horatiu.vultur@...rochip.com>
To:     Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
CC:     <netdev@...r.kernel.org>, <davem@...emloft.net>, <kuba@...nel.org>,
        <linux-kernel@...r.kernel.org>, <bryan.whitehead@...rochip.com>,
        <pabeni@...hat.com>, <edumazet@...gle.com>, <olteanv@...il.com>,
        <linux@...linux.org.uk>, <UNGLinuxDriver@...rochip.com>,
        <andrew@...n.ch>, <Ian.Saturley@...rochip.com>
Subject: Re: [PATCH net-next V6 1/2] net: lan743x: Remove unused argument in
 lan743x_common_regs( )

The 11/02/2022 16:18, Raju Lakkaraju wrote:

Hi Raju,

> Remove the unused argument (i.e. struct ethtool_regs *regs) in
> lan743x_common_regs( ) function arguments.
> 
> Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
> ---
>  drivers/net/ethernet/microchip/lan743x_ethtool.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan743x_ethtool.c b/drivers/net/ethernet/microchip/lan743x_ethtool.c
> index 88f9484cc2a7..fd59708ac4b5 100644
> --- a/drivers/net/ethernet/microchip/lan743x_ethtool.c
> +++ b/drivers/net/ethernet/microchip/lan743x_ethtool.c
> @@ -1190,15 +1190,11 @@ static int lan743x_ethtool_set_wol(struct net_device *netdev,
>  }
>  #endif /* CONFIG_PM */
>  
> -static void lan743x_common_regs(struct net_device *dev,
> -				struct ethtool_regs *regs, void *p)
> -
> +static void lan743x_common_regs(struct net_device *dev, void *p)
>  {
>  	struct lan743x_adapter *adapter = netdev_priv(dev);
>  	u32 *rb = p;
>  
> -	memset(p, 0, (MAX_LAN743X_ETH_REGS * sizeof(u32)));
> -

It seems that you do more here than what you said.
You remove the unused argument but you also remove the memset. And it
is a problem because p is not initialized anymore.

>  	rb[ETH_PRIV_FLAGS] = adapter->flags;
>  	rb[ETH_ID_REV]     = lan743x_csr_read(adapter, ID_REV);
>  	rb[ETH_FPGA_REV]   = lan743x_csr_read(adapter, FPGA_REV);
> @@ -1230,7 +1226,7 @@ static void lan743x_get_regs(struct net_device *dev,
>  {
>  	regs->version = LAN743X_ETH_REG_VERSION;
>  
> -	lan743x_common_regs(dev, regs, p);
> +	lan743x_common_regs(dev, p);
>  }
>  
>  static void lan743x_get_pauseparam(struct net_device *dev,
> -- 
> 2.25.1
> 

-- 
/Horatiu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ