drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire()

The zero value returned from qbman_swp_acquire() is an error
condition meaning no free buffer for allocation.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Kushwaha Prabhakar <prabhakar@freescale.com>
[YS: revised commit message]
Reviewed-by: York Sun <york.sun@nxp.com>
master
Ashish Kumar 7 years ago committed by York Sun
parent c253573f3e
commit 5e9445da28
  1. 2
      drivers/net/ldpaa_eth/ldpaa_eth.c

@ -334,7 +334,7 @@ static int ldpaa_eth_tx(struct eth_device *net_dev, void *buf, int len)
&buffer_start, 1);
} while (err == -EBUSY);
if (err < 0) {
if (err <= 0) {
printf("qbman_swp_acquire() failed\n");
return -ENOMEM;
}

Loading…
Cancel
Save