From: Michael Buesch <mb@bu3sch.de>
To: "John W. Linville" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>,
Larry Finger <Larry.Finger@lwfinger.net>
Subject: Re: [PATCH V3] ssb: do not read SPROM if it does not exist
Date: Thu, 1 Apr 2010 15:28:19 +0100 [thread overview]
Message-ID: <201004011628.19654.mb@bu3sch.de> (raw)
In-Reply-To: <1270064375-3138-2-git-send-email-linville@tuxdriver.com>
On Wednesday 31 March 2010 21:39:35 John W. Linville wrote:
> diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
> index 9e50896..a4b2b99 100644
> --- a/drivers/ssb/pci.c
> +++ b/drivers/ssb/pci.c
> @@ -620,6 +620,11 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
> int err = -ENOMEM;
> u16 *buf;
>
> + if (!ssb_is_sprom_available(bus)) {
> + ssb_printk(KERN_ERR PFX "No SPROM available!\n");
> + return -ENODEV;
> + }
Note that in ssb_pci_init() you might also want to add such a check to avoid
registering the "sprom" sysfs file in case there's no sprom. Otherwise root is
able to crash the machine via that file. Same goes for ssb_pci_exit(), of course.
--
Greetings, Michael.
next prev parent reply other threads:[~2010-04-01 14:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-31 19:39 [PATCH V3] ssb: do not read SPROM if it does not exist John W. Linville
2010-03-31 19:42 ` Rafał Miłecki
2010-04-01 14:23 ` Michael Buesch
2010-04-01 14:28 ` Michael Buesch [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-03-19 20:33 [PATCH v2] " John W. Linville
2010-03-19 20:41 ` [PATCH v3] " John W. Linville
2010-03-19 21:12 ` Michael Buesch
2010-03-19 22:10 ` John W. Linville
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=201004011628.19654.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=Larry.Finger@lwfinger.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=zajec5@gmail.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.