From: Takashi Iwai <tiwai@suse.de>
To: "Alexey Khoroshilov" <khoroshilov@ispras.ru>
Cc: "Jaroslav Kysela" <perex@perex.cz>, <alsa-devel@alsa-project.org>,
<ldv-project@linuxtesting.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sound: fix check for error condition of register_chrdev()
Date: Sat, 07 Nov 2015 11:15:02 +0100 [thread overview]
Message-ID: <s5h7flukteh.wl-tiwai@suse.de> (raw)
In-Reply-To: <1446850565-8451-1-git-send-email-khoroshilov@ispras.ru>
On Fri, 06 Nov 2015 23:56:05 +0100,
Alexey Khoroshilov wrote:
>
> init_oss_soundcore() compares returned value of register_chrdev()
> with -1, while other error codes can be returned.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Thanks, applied.
Takashi
> ---
> sound/sound_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/sound_core.c b/sound/sound_core.c
> index 11e953a1fa45..99b73c675743 100644
> --- a/sound/sound_core.c
> +++ b/sound/sound_core.c
> @@ -655,7 +655,7 @@ static void cleanup_oss_soundcore(void)
> static int __init init_oss_soundcore(void)
> {
> if (preclaim_oss &&
> - register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops) == -1) {
> + register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops) < 0) {
> printk(KERN_ERR "soundcore: sound device already in use.\n");
> return -EBUSY;
> }
> --
> 1.9.1
>
>
prev parent reply other threads:[~2015-11-07 10:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 22:56 [PATCH] sound: fix check for error condition of register_chrdev() Alexey Khoroshilov
2015-11-07 10:15 ` Takashi Iwai [this message]
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=s5h7flukteh.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=khoroshilov@ispras.ru \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
/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