alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Re: ALSA: emu10k1: Use standard printk helpers
@ 2014-03-05 11:05 Dan Carpenter
  2014-03-05 11:11 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-03-05 11:05 UTC (permalink / raw)
  To: tiwai; +Cc: alsa-devel

Hello Takashi Iwai,

The patch 6f002b02166c: "ALSA: emu10k1: Use standard printk helpers"
from Feb 25, 2014, leads to the following static checker warning:

	sound/pci/emu10k1/io.c:75 snd_emu10k1_ptr_write()
	error: we previously assumed 'emu' could be null (see line 74)

sound/pci/emu10k1/io.c
    68  void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data)
    69  {
    70          unsigned int regptr;
    71          unsigned long flags;
    72          unsigned int mask;
    73  
    74          if (!emu) {
                    ^^^^
    75                  dev_err(emu->card->dev, "ptr_write: emu is null!\n");
                                ^^^^^^^^^^^^^^
Dereference.

    76                  dump_stack();
    77                  return;
    78          }

regards,
dan carpenter

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

* Re: ALSA: emu10k1: Use standard printk helpers
  2014-03-05 11:05 ALSA: emu10k1: Use standard printk helpers Dan Carpenter
@ 2014-03-05 11:11 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2014-03-05 11:11 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: alsa-devel

At Wed, 5 Mar 2014 14:05:09 +0300,
Dan Carpenter wrote:
> 
> Hello Takashi Iwai,
> 
> The patch 6f002b02166c: "ALSA: emu10k1: Use standard printk helpers"
> from Feb 25, 2014, leads to the following static checker warning:
> 
> 	sound/pci/emu10k1/io.c:75 snd_emu10k1_ptr_write()
> 	error: we previously assumed 'emu' could be null (see line 74)
> 
> sound/pci/emu10k1/io.c
>     68  void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data)
>     69  {
>     70          unsigned int regptr;
>     71          unsigned long flags;
>     72          unsigned int mask;
>     73  
>     74          if (!emu) {
>                     ^^^^
>     75                  dev_err(emu->card->dev, "ptr_write: emu is null!\n");
>                                 ^^^^^^^^^^^^^^
> Dereference.
> 
>     76                  dump_stack();
>     77                  return;

Damn, this should be simply converted to WARN_ON().
I'll fix it.


thanks,

Takashi

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

end of thread, other threads:[~2014-03-05 11:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-05 11:05 ALSA: emu10k1: Use standard printk helpers Dan Carpenter
2014-03-05 11:11 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).