Skip to contentSkip to conversation

ALSA: echoaudio: remove all snd_printk

DISCUSSION Dan Carpenter 3 participants 3 messages Nov 4, 2014

lore
Share & tools
lore
#0 lore raw

Hello Sudip Mukherjee,

The patch b5b4a41b3929: "ALSA: echoaudio: remove all snd_printk" from Nov 3, 2014, leads to the following static checker warning:

sound/pci/echoaudio/echoaudio.c:1908 snd_echo_free()
error: dereferencing freed memory 'chip'

sound/pci/echoaudio/echoaudio.c

  1905          /* release chip data */
  1906          free_firmware_cache(chip);
  1907          kfree(chip);
                ^^^^^^^^^^^
  1908          dev_dbg(chip->card->dev, "Chip freed.\n");
                        ^^^^^^^^^^

We have lots of printks in this function. We could just delete them all and no one would care. These days you can get the same information from ftrace.

1909 return 0;
1910 }

regards,
dan carpenter

#1 lore raw

At Tue, 4 Nov 2014 19:01:56 +0300,

Quoted 17 lines · Dan Carpenter

Hello Sudip Mukherjee,

The patch b5b4a41b3929: "ALSA: echoaudio: remove all snd_printk" from Nov 3, 2014, leads to the following static checker warning:

sound/pci/echoaudio/echoaudio.c:1908 snd_echo_free()
error: dereferencing freed memory 'chip'

sound/pci/echoaudio/echoaudio.c

  1905          /* release chip data */
  1906          free_firmware_cache(chip);
  1907          kfree(chip);
                ^^^^^^^^^^^
  1908          dev_dbg(chip->card->dev, "Chip freed.\n");
                        ^^^^^^^^^^
Quoted 3 lines

We have lots of printks in this function. We could just delete them all and no one would care. These days you can get the same information from ftrace.

Yep, maybe it's a wiser choice. Sudip, care to send a clean up patch?

thanks,

Takashi

#2 lore raw
Quoted 18 lines · Takashi Iwai

At Tue, 4 Nov 2014 19:01:56 +0300,

Quoted 16 lines · Dan Carpenter

Hello Sudip Mukherjee,

The patch b5b4a41b3929: "ALSA: echoaudio: remove all snd_printk" from Nov 3, 2014, leads to the following static checker warning:

sound/pci/echoaudio/echoaudio.c:1908 snd_echo_free()
error: dereferencing freed memory 'chip'

sound/pci/echoaudio/echoaudio.c

  1905          /* release chip data */
  1906          free_firmware_cache(chip);
  1907          kfree(chip);
                ^^^^^^^^^^^
  1908          dev_dbg(chip->card->dev, "Chip freed.\n");
                        ^^^^^^^^^^

oops , missed it. sorry.

Quoted 7 lines
Quoted 4 lines

We have lots of printks in this function. We could just delete them all and no one would care. These days you can get the same information from ftrace.

Yep, maybe it's a wiser choice. Sudip, care to send a clean up patch?

sure. i have alredy started. cleanup like Joe Perches suggested from all the functions.

thanks
sudip

Quoted 4 lines

thanks,

Takashi