[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CY1PR0701MB201234A30578ED57BA9EAE6E88580@CY1PR0701MB2012.namprd07.prod.outlook.com>
Date: Sun, 29 Oct 2017 07:50:06 +0000
From: "Kalderon, Michal" <Michal.Kalderon@...ium.com>
To: Dan Carpenter <dan.carpenter@...cle.com>,
"Elior, Ariel" <Ariel.Elior@...ium.com>
CC: Dept-Eng Everest Linux L2 <Dept-EngEverestLinuxL2@...ium.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH net-next] qed: Set error code for allocation failures
From: Dan Carpenter <dan.carpenter@...cle.com>
Sent: Friday, October 27, 2017 9:40 AM
> There are several places where we accidentally return success when
> kcalloc() fails.
>
> Fixes: fcb39f6c10b2 ("qed: Add mpa buffer descriptors for storing and processing mpa fpdus")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> index 409041eab189..6366f2ef82b7 100644
> --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> @@ -2585,7 +2585,7 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
> struct qed_ll2_cbs cbs;
> u32 mpa_buff_size;
> u16 n_ooo_bufs;
> - int rc = 0;
> + int rc;
> int i;
>
> iwarp_info = &p_hwfn->p_rdma_info->iwarp;
> @@ -2696,6 +2696,7 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
> if (rc)
> goto err;
>
> + rc = -ENOMEM;
> iwarp_info->partial_fpdus = kcalloc((u16)p_hwfn->p_rdma_info->num_qps,
> sizeof(*iwarp_info->partial_fpdus),
> GFP_KERNEL);
> @@ -2724,7 +2725,7 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
> for (i = 0; i < data.input.rx_num_desc; i++)
> list_add_tail(&iwarp_info->mpa_bufs[i].list_entry,
> &iwarp_info->mpa_buf_list);
> - return rc;
> + return 0;
> err:
> qed_iwarp_ll2_stop(p_hwfn, p_ptt);
Thanks Dan,
Acked-by: Michal Kalderon <michal.kalderon@...ium.com>
Powered by blists - more mailing lists