]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
cxgb3: fix error return code in t3_sge_alloc_qset()
authorZhang Changzhong <zhangchangzhong@huawei.com>
Wed, 2 Dec 2020 09:56:05 +0000 (17:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Dec 2020 09:17:34 +0000 (10:17 +0100)
[ Upstream commit ff9924897f8bfed82e61894b373ab9d2dfea5b10 ]

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: b1fb1f280d09 ("cxgb3 - Fix dma mapping error path")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: Raju Rangoju <rajur@chelsio.com>
Link: https://lore.kernel.org/r/1606902965-1646-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/chelsio/cxgb3/sge.c

index e2d342647b19485ec0c497d3b60985d7e1693a1a..454fee4ea9e621cf581094ba3915d415a00c71b3 100644 (file)
@@ -3111,6 +3111,7 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,
                          GFP_KERNEL | __GFP_COMP);
        if (!avail) {
                CH_ALERT(adapter, "free list queue 0 initialization failed\n");
+               ret = -ENOMEM;
                goto err;
        }
        if (avail < q->fl[0].size)