[bug report] ASoC: cx20442: replace codec to component

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ I don't know why I am seeing warnings from 2018 today.  Also this
  patch didn't really introduce the bug, it's just the variables were
  renamed. -dan ]

Hello Kuninori Morimoto,

This is a semi-automatic email about new static checker warnings.

The patch d0fdfe34080c: "ASoC: cx20442: replace codec to component"
from Jan 29, 2018, leads to the following Smatch complaint:

    sound/soc/ti/ams-delta.c:311 cx81801_close()
    warn: variable dereferenced before check 'component' (see line 304)

sound/soc/ti/ams-delta.c
   303		struct snd_soc_component *component = tty->disc_data;
   304		struct snd_soc_dapm_context *dapm = &component->card->dapm;
                                                    ^^^^^^^^^^^^^^^^^^
Dereference.

   305	
   306		del_timer_sync(&cx81801_timer);
   307	
   308		/* Prevent the hook switch from further changing the DAPM pins */
   309		INIT_LIST_HEAD(&ams_delta_hook_switch.pins);
   310	
   311		if (!component)
                    ^^^^^^^^^^
Check for NULL is too late.

   312			return;
   313	

regards,
dan carpenter



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux