From: Dan Carpenter <error27@gmail.com>
To: Kulikov Vasiliy <segooon@gmail.com>
Cc: kernel-janitors@vger.kernel.org,
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: Re: [PATCH 09/10] oss: msnd: check request_region() return value
Date: Wed, 28 Jul 2010 22:00:02 +0200 [thread overview]
Message-ID: <20100728200002.GP26313@bicker> (raw)
In-Reply-To: <1280335296-23475-1-git-send-email-segooon@gmail.com>
On Wed, Jul 28, 2010 at 08:41:36PM +0400, Kulikov Vasiliy wrote:
> 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);
This should be -EBUSY as well. The same for "[PATCH 06/10] ALSA: msnd:
check request_region() return value"
Another way to write that would be:
- request_region(dev.io, dev.numio, dev.name);
+ err = request_region(dev.io, dev.numio, dev.name);
+ if (err) {
+ free_irq(dev.irq, &dev);
+ return err;
+ }
regards,
dan carpenter
> + if (request_region(dev.io, dev.numio, dev.name) == NULL) {
> + free_irq(dev.irq, &dev);
> + return -ENOMEM;
> + }
next prev parent reply other threads:[~2010-07-28 20:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-28 16:41 [PATCH 09/10] oss: msnd: check request_region() return value Kulikov Vasiliy
2010-07-28 20:00 ` Dan Carpenter [this message]
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=20100728200002.GP26313@bicker \
--to=error27@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=segooon@gmail.com \
--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