From: Marcel Holtmann <marcel@holtmann.org>
To: Dan Carpenter <error27@gmail.com>
Cc: samuel.ortiz@intel.com, yi.zhu@intel.com, linux-wireless@vger.kernel.org
Subject: Re: [patch] wireless: ERR_PTR vs null
Date: Sat, 25 Jul 2009 14:46:05 +0200 [thread overview]
Message-ID: <1248525965.28545.158.camel@violet> (raw)
In-Reply-To: <alpine.DEB.2.00.0907241000250.11771@bicker>
Hi Dan,
> iwm_wdev_alloc() returns an ERR_PTR on failure and not null. It also
> prints its own dev_err() message so I removed that as well.
>
> Compile tested only. Sorry.
> Found by smatch (http://repo.or.cz/w/smatch.git).
>
> regards,
> dan carpenter
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> --- orig/drivers/net/wireless/iwmc3200wifi/netdev.c 2009-07-24 09:56:49.000000000 +0300
> +++ devel/drivers/net/wireless/iwmc3200wifi/netdev.c 2009-07-24 09:57:31.000000000 +0300
> @@ -106,10 +106,8 @@
> int ret = 0;
>
> wdev = iwm_wdev_alloc(sizeof_bus, dev);
> - if (!wdev) {
> - dev_err(dev, "no memory for wireless device instance\n");
> - return ERR_PTR(-ENOMEM);
> - }
> + if (IS_ERR(wdev))
> + return wdev;
>
> iwm = wdev_to_iwm(wdev);
> iwm->bus_ops = if_ops;
I just quickly double-checked with the code. Patch looks good.
Regards
Marcel
next prev parent reply other threads:[~2009-07-25 12:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-25 12:22 [patch] wireless: ERR_PTR vs null Dan Carpenter
2009-07-25 12:46 ` Marcel Holtmann [this message]
2009-07-27 1:26 ` Zhu Yi
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=1248525965.28545.158.camel@violet \
--to=marcel@holtmann.org \
--cc=error27@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=samuel.ortiz@intel.com \
--cc=yi.zhu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.