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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1427908299.31790.51.camel@perches.com>
Date:	Wed, 01 Apr 2015 10:11:39 -0700
From:	Joe Perches <joe@...ches.com>
To:	madalin.bucur@...escale.com
Cc:	netdev@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 06/10] dpaa_eth: add ethtool functionality

On Wed, 2015-04-01 at 19:19 +0300, Madalin Bucur wrote:
> Add support for basic ethtool operations.

> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
[]
> +static int __cold dpa_get_settings(struct net_device *net_dev,
> +				   struct ethtool_cmd *et_cmd)
> +{
> +	int			 _errno;

Using a variable name of _errno is misleading at best,
(btw: the only return value for phy_ethtool_gset is 0)

> +static void __cold dpa_get_drvinfo(struct net_device *net_dev,
> +				   struct ethtool_drvinfo *drvinfo)
> +{
> +	int		 _errno;
> +
> +	strncpy(drvinfo->driver, KBUILD_MODNAME,
> +		sizeof(drvinfo->driver) - 1)[sizeof(drvinfo->driver) - 1] = 0;

That's a really odd and unusual construct
more commonly written as strlcpy

> +	_errno = snprintf(drvinfo->version, sizeof(drvinfo->version),

Using errno here is especially misleading as that's
not the return value of an snprintf



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ