From: Kulikov Vasiliy <segooon@gmail.com>
To: kernel-janitors@vger.kernel.org
Cc: Andrew Veliath <andrewtv@usa.net>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
Arnd Bergmann <arnd@arndb.de>, Tejun Heo <tj@kernel.org>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: [PATCH 09/10] oss: msnd: check request_region() return value
Date: Wed, 28 Jul 2010 20:41:36 +0400 [thread overview]
Message-ID: <1280335296-23475-1-git-send-email-segooon@gmail.com> (raw)
request_region() may fail, if so return -ENOMEM.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
sound/oss/msnd_pinnacle.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
index bfaac5f..cd70b9a 100644
--- a/sound/oss/msnd_pinnacle.c
+++ b/sound/oss/msnd_pinnacle.c
@@ -1400,9 +1400,13 @@ static int __init attach_multisound(void)
printk(KERN_ERR LOGNAME ": Couldn't grab IRQ %d\n", dev.irq);
return err;
}
- request_region(dev.io, dev.numio, dev.name);
+ if (request_region(dev.io, dev.numio, dev.name) == NULL) {
+ free_irq(dev.irq, &dev);
+ return -ENOMEM;
+ }
- if ((err = dsp_full_reset()) < 0) {
+ err = dsp_full_reset();
+ if (err < 0) {
release_region(dev.io, dev.numio);
free_irq(dev.irq, &dev);
return err;
--
1.7.0.4
next reply other threads:[~2010-07-28 16:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-28 16:41 Kulikov Vasiliy [this message]
2010-07-28 20:00 ` [PATCH 09/10] oss: msnd: check request_region() return value Dan Carpenter
2010-07-28 21:20 ` Dan Carpenter
2010-07-29 10:22 ` Takashi Iwai
2010-07-29 10:40 ` Vasiliy Kulikov
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=1280335296-23475-1-git-send-email-segooon@gmail.com \
--to=segooon@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=andrewtv@usa.net \
--cc=arnd@arndb.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
--cc=tj@kernel.org \
/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