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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 21 Aug 2017 21:08:53 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>
Cc:     netdev@...r.kernel.org, davem@...emloft.net,
        fengguang.wu@...el.com, dcbw@...hat.com, jiri@...nulli.us,
        David.Laight@...LAB.COM, marcel@...tmann.org
Subject: Re: [PATCH net-next 3/3 v5] drivers: net: ethernet: qualcomm:
 rmnet: Initial implementation

> +void rmnet_vnd_setup(struct net_device *rmnet_dev)
> +{
> +	struct rmnet_priv *priv;
> +
> +	/* Clear out private data */
> +	priv = netdev_priv(rmnet_dev);
> +	memset(priv, 0, sizeof(struct rmnet_priv));

Netdev private area is always zero on creation. See alloc_netdev().


> +struct rmnet_endpoint *rmnet_vnd_get_endpoint(struct net_device *rmnet_dev)
> +{
> +	struct rmnet_priv *priv;
> +
> +	if (!rmnet_dev)
> +		return 0;

Do not confuse 0 with NULL. Did you run sparse?

> +
> +	priv = netdev_priv(rmnet_dev);
> +	if (!priv)
> +		return 0;


netdev_priv() always returns a non-NULL value.  The private area is just
a constant offset below the original network_device structure.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ