From: Ashish Kumar Date: Thu, 26 Oct 2017 10:33:22 +0000 (+0530) Subject: drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire() X-Git-Tag: v2018.01-rc1~127^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e9445da288c5121546235e8201768abd087b281;p=platform%2Fkernel%2Fu-boot.git 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 Signed-off-by: Kushwaha Prabhakar [YS: revised commit message] Reviewed-by: York Sun --- diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c index f235b62..21be79a 100644 --- a/drivers/net/ldpaa_eth/ldpaa_eth.c +++ b/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; }