public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] NULL pointer dereference in sound/synth/emux/soundfont.c
@ 2006-05-30 20:18 Eric Sesterhenn
  2006-05-31  9:56 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sesterhenn @ 2006-05-30 20:18 UTC (permalink / raw)
  To: LKML; +Cc: tiwai

hi,

this is about coverity id #100.
It seems the if statement is negated, since the else branch calls
remove_info() with sflist->currsf as a parameter where it gets
dereferenced.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.17-rc4-git2/sound/synth/emux/soundfont.c.orig	2006-05-30 22:08:40.000000000 +0200
+++ linux-2.6.17-rc4-git2/sound/synth/emux/soundfont.c	2006-05-30 22:08:51.000000000 +0200
@@ -195,7 +195,7 @@ snd_soundfont_load(struct snd_sf_list *s
 		break;
 	case SNDRV_SFNT_REMOVE_INFO:
 		/* patch must be opened */
-		if (sflist->currsf) {
+		if (!sflist->currsf) {
 			snd_printk("soundfont: remove_info: patch not opened\n");
 			rc = -EINVAL;
 		} else {



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch] NULL pointer dereference in sound/synth/emux/soundfont.c
  2006-05-30 20:18 [Patch] NULL pointer dereference in sound/synth/emux/soundfont.c Eric Sesterhenn
@ 2006-05-31  9:56 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2006-05-31  9:56 UTC (permalink / raw)
  To: Eric Sesterhenn; +Cc: LKML

At Tue, 30 May 2006 22:18:16 +0200,
Eric Sesterhenn wrote:
> 
> hi,
> 
> this is about coverity id #100.
> It seems the if statement is negated, since the else branch calls
> remove_info() with sflist->currsf as a parameter where it gets
> dereferenced.
> 
> Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

Thanks, I applied it to ALSA tree.


Takashi

> 
> --- linux-2.6.17-rc4-git2/sound/synth/emux/soundfont.c.orig	2006-05-30 22:08:40.000000000 +0200
> +++ linux-2.6.17-rc4-git2/sound/synth/emux/soundfont.c	2006-05-30 22:08:51.000000000 +0200
> @@ -195,7 +195,7 @@ snd_soundfont_load(struct snd_sf_list *s
>  		break;
>  	case SNDRV_SFNT_REMOVE_INFO:
>  		/* patch must be opened */
> -		if (sflist->currsf) {
> +		if (!sflist->currsf) {
>  			snd_printk("soundfont: remove_info: patch not opened\n");
>  			rc = -EINVAL;
>  		} else {
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-31  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-30 20:18 [Patch] NULL pointer dereference in sound/synth/emux/soundfont.c Eric Sesterhenn
2006-05-31  9:56 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox