]> git.sur5r.net Git - u-boot/commitdiff
drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire()
authorAshish Kumar <Ashish.Kumar@nxp.com>
Thu, 26 Oct 2017 10:33:22 +0000 (16:03 +0530)
committerYork Sun <york.sun@nxp.com>
Tue, 14 Nov 2017 16:33:20 +0000 (08:33 -0800)
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>
drivers/net/ldpaa_eth/ldpaa_eth.c

index f235b622b6f39489ddbdce0cc13d3d428b470705..21be79a58ad4618d4e9f08054c350b316f9c6953 100644 (file)
@@ -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;
        }