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] [day] [month] [year] [list]
Date:	Tue, 6 May 2014 22:18:15 +0200
From:	Darek Marcinkiewicz <reksio@...term.pl>
To:	Tobias Klauser <tklauser@...tanz.ch>
Cc:	davem@...emloft.net, romieu@...zoreil.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 1/1] Driver for Beckhoff CX5020 EtherCAT master module.

On Tue, May 06, 2014 at 04:56:06PM +0200, Tobias Klauser wrote:
> > +		if (skb) {
> > +			memcpy(skb_put(skb, pkt_size), data, pkt_size);
> > +			skb->protocol = eth_type_trans(skb, priv->net_dev);
> > +			dev_dbg(dev, "Protocol type: %x\n", skb->protocol);
> > +
> > +			netif_rx(skb);
> > +		} else {
> > +			dev_err_ratelimited(dev,
> > +				"Couldn't allocate a skb_buff for a packet of size %u\n",
> > +				pkt_size);
> > +		}
> > +
> > +		priv->stat_rx_bytes += pkt_size;
> 
> This should only be incremented if the packet was actually passed to
> netif_rx(), no?
Yes, I guees it should.
> 
> > +
> > +static struct rtnl_link_stats64 *
> > +ec_bhf_get_stats(struct net_device *net_dev,
> > +		 struct rtnl_link_stats64 *stats)
> > +{
> > +	struct ec_bhf_priv *priv = netdev_priv(net_dev);
> > +
> > +	memset(stats, 0, sizeof(*stats));
> 
> No need to memset() here, this is already done in dev_get_stats()
> 
Ok, thanks. Will send updated patch.

-- 
DM
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists