dpaa_eth: small leak on error
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 16 Feb 2017 09:56:10 +0000 (12:56 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Feb 2017 17:18:43 +0000 (12:18 -0500)
This should be >= instead of > here.  It means that we don't increment
the free count enough so it becomes off by one.

Fixes: 9ad1a3749333 ("dpaa_eth: add support for DPAA Ethernet")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

index c9b7ad65e5633bc2a5147706f5c728f4d1cffa3c..726b5693ae8a5a3a9364e5de13195d36c5b1d06f 100644 (file)
@@ -1668,7 +1668,7 @@ static struct sk_buff *sg_fd_to_skb(const struct dpaa_priv *priv,
 
 free_buffers:
        /* compensate sw bpool counter changes */
-       for (i--; i > 0; i--) {
+       for (i--; i >= 0; i--) {
                dpaa_bp = dpaa_bpid2pool(sgt[i].bpid);
                if (dpaa_bp) {
                        count_ptr = this_cpu_ptr(dpaa_bp->percpu_count);