From: Christian Lamparter <chunkeey@web.de>
To: linux-wireless@vger.kernel.org
Cc: Max Filippov <jcmvbkbc@gmail.com>,
Dan Carpenter <error27@gmail.com>,
"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH v2] p54spi: fix potential null deref in p54spi.c
Date: Sun, 19 Jul 2009 21:26:13 +0200 [thread overview]
Message-ID: <200907192126.13207.chunkeey@web.de> (raw)
In-Reply-To: <alpine.DEB.2.00.0907171607280.12306@bicker>
From: Dan Carpenter <error27@gmail.com>
Fix a potential NULL dereference bug during
error handling in p54spi_probe.
This bug was discovered by smatch:
(http://repo.or.cz/w/smatch.git).
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@web.de>
---
On Sunday 19 July 2009 13:53:57 Dan Carpenter wrote:
> We can't use dev_err() becuase "priv" is NULL.
yep, but that's my fault and not Micheal's.
> Found by smatch (http://repo.or.cz/w/smatch.git).
> regards,
> dan carpenter
what about this alternative?
it retains the dev_err by simply moving to the spi_device *spi
which comes from spi-subsystem and is initialized?
Regards,
Chr
---
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index d5f181a..eef5329 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -600,7 +600,7 @@ static int __devinit p54spi_probe(struct spi_device *spi)
hw = p54_init_common(sizeof(*priv));
if (!hw) {
- dev_err(&priv->spi->dev, "could not alloc ieee80211_hw");
+ dev_err(&spi->dev, "could not alloc ieee80211_hw");
return -ENOMEM;
}
next prev parent reply other threads:[~2009-07-19 19:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-19 11:53 [patch] wireless: potential null deref in p54spi.c Dan Carpenter
2009-07-19 19:26 ` Christian Lamparter [this message]
2009-07-22 14:40 ` [PATCH v2] p54spi: fix " Dan Carpenter
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=200907192126.13207.chunkeey@web.de \
--to=chunkeey@web.de \
--cc=error27@gmail.com \
--cc=jcmvbkbc@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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).