From: David Miller <davem@davemloft.net>
To: yuehaibing@huawei.com
Cc: ganeshgr@chelsio.com, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] cxgb4: Check for kvzalloc allocation failure
Date: Thu, 24 May 2018 11:07:43 -0400 (EDT) [thread overview]
Message-ID: <20180524.110743.522760687215216591.davem@davemloft.net> (raw)
In-Reply-To: <20180522070718.12864-1-yuehaibing@huawei.com>
From: YueHaibing <yuehaibing@huawei.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.
next prev parent reply other threads:[~2018-05-24 15:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-22 7:07 YueHaibing
2018-05-24 15:07 ` David Miller [this message]
2018-05-25 1:39 ` YueHaibing
2018-05-25 1:52 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180524.110743.522760687215216591.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ganeshgr@chelsio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yuehaibing@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®