[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180524.110743.522760687215216591.davem@davemloft.net>
Date: Thu, 24 May 2018 11:07:43 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: yuehaibing@...wei.com
Cc: ganeshgr@...lsio.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next] cxgb4: Check for kvzalloc allocation failure
From: YueHaibing <yuehaibing@...wei.com>
Date: Tue, 22 May 2018 15:07:18 +0800
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
> index 130d1ee..019cffe 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
> @@ -4135,6 +4135,10 @@ static int adap_init0(struct adapter *adap)
> * card
> */
> card_fw = kvzalloc(sizeof(*card_fw), GFP_KERNEL);
> + if (!card_fw) {
> + ret = -ENOMEM;
> + goto bye;
> + }
>
On error, this leaks fw_info.
Powered by blists - more mailing lists