[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1421222782.2847.1.camel@perches.com>
Date: Wed, 14 Jan 2015 00:06:22 -0800
From: Joe Perches <joe@...ches.com>
To: Ding Tianhong <dingtianhong@...wei.com>
Cc: arnd@...db.de, robh+dt@...nel.org, davem@...emloft.net,
grant.likely@...aro.org, agraf@...e.de,
sergei.shtylyov@...entembedded.com,
linux-arm-kernel@...ts.infradead.org, eric.dumazet@...il.com,
xuwei5@...ilicon.com, zhangfei.gao@...aro.org,
netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux@....linux.org.uk
Subject: Re: [PATCH net-next v13 3/3] net: hisilicon: new hip04 ethernet
driver
On Wed, 2015-01-14 at 14:34 +0800, Ding Tianhong wrote:
> Support Hisilicon hip04 ethernet driver, including 100M / 1000M controller.
> The controller has no tx done interrupt, reclaim xmitted buffer in the poll.
Single comment:
> diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
[]
> +static int hip04_rx_poll(struct napi_struct *napi, int budget)
> +{
[]
> + while (cnt && !last) {
> + buf = priv->rx_buf[priv->rx_head];
> + skb = build_skb(buf, priv->rx_buf_size);
> + if (unlikely(!skb))
> + net_dbg_ratelimited("build_skb failed\n");
> +
> + dma_unmap_single(&ndev->dev, priv->rx_phys[priv->rx_head],
> + RX_BUF_SIZE, DMA_FROM_DEVICE);
> + priv->rx_phys[priv->rx_head] = 0;
> +
> + desc = (struct rx_desc *)skb->data;
Perhaps if (!skb) is possible, there shouldn't be
a dereference of that known null here.
--
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