From: Christophe JAILLET Date: Thu, 21 Sep 2017 23:01:11 +0000 (+0200) Subject: cnic: Fix an error handling path in 'cnic_alloc_bnx2x_resc()' X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=05cf97e7a619fc7ede81ee6bb8ebfa7531b633f5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git cnic: Fix an error handling path in 'cnic_alloc_bnx2x_resc()' All the error handling paths 'goto error', except this one. We should also go to error in this case, or some resources will be leaking. Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index cec94bbb2ea5..8bc126a156e8 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c @@ -1278,7 +1278,7 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev) ret = cnic_alloc_dma(dev, kwq_16_dma, pages, 0); if (ret) - return -ENOMEM; + goto error; n = CNIC_PAGE_SIZE / CNIC_KWQ16_DATA_SIZE; for (i = 0, j = 0; i < cp->max_cid_space; i++) {