From: Ashish Kumar Date: Thu, 26 Oct 2017 16:03:22 +0530 Subject: [U-Boot] [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire() Message-ID: <1509014002-29547-1-git-send-email-Ashish.Kumar@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Correcting error handing for qbman_swp_acquire. The return value is zero is an error condition since number of buffer copied is zero meaning there are no free buffers for allocation. Signed-off-by: Ashish Kumar Signed-off-by: Kushwaha Prabhakar --- drivers/net/ldpaa_eth/ldpaa_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.7.4