From: Christoph Fritz <chf.fritz@googlemail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
kernel-janitors <kernel-janitors@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Reinette Chatre <reinette.chatre@intel.com>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] wireless: ipw2100: check result of kzalloc()
Date: Tue, 03 Aug 2010 12:28:42 +0200 [thread overview]
Message-ID: <1280831322.3034.7.camel@lovely.krouter> (raw)
In-Reply-To: <20100803081701.GP26313@bicker>
On Tue, 2010-08-03 at 10:17 +0200, Dan Carpenter wrote:
> On Tue, Aug 03, 2010 at 03:10:22AM +0200, Christoph Fritz wrote:
> > If kzalloc() fails return with -ENOMEM from ipw2100_net_init() which is
> > called by register_netdev.
> >
> > Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
> > ---
> > drivers/net/wireless/ipw2x00/ipw2100.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
> > index 0bd4dfa..908c176 100644
> > --- a/drivers/net/wireless/ipw2x00/ipw2100.c
> > +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
> > @@ -1924,6 +1924,8 @@ static int ipw2100_net_init(struct net_device *dev)
> > bg_band->channels =
> > kzalloc(geo->bg_channels *
> > sizeof(struct ieee80211_channel), GFP_KERNEL);
> > + if (!bg_band->channels)
>
> There should be an "ipw2100_down(priv);" on the error path here.
thanks for pointing this out, I'll add this.
>
> > + return -ENOMEM;
> > /* translate geo->bg to bg_band.channels */
>
next prev parent reply other threads:[~2010-08-03 10:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-03 1:10 [PATCH] wireless: ipw2100: check result of kzalloc() Christoph Fritz
2010-08-03 8:17 ` Dan Carpenter
2010-08-03 10:28 ` Christoph Fritz [this message]
2010-08-03 10:54 ` [PATCH v2] " Christoph Fritz
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=1280831322.3034.7.camel@lovely.krouter \
--to=chf.fritz@googlemail.com \
--cc=davem@davemloft.net \
--cc=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=reinette.chatre@intel.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;
as well as URLs for NNTP newsgroup(s).