• Pierre-Louis Bossart's avatar
    ALSA: core: pcm_memory: dereference pointer after NULL checks · b658cbab
    Pierre-Louis Bossart authored
    Fix cppcheck warnings:
    
    sound/core/pcm_memory.c:380:26: warning: Either the condition
    '!substream' is redundant or there is possible null pointer
    dereference: substream. [nullPointerRedundantCheck]
     struct snd_card *card = substream->pcm->card;
                             ^
    sound/core/pcm_memory.c:384:6: note: Assuming that condition
    '!substream' is not redundant
     if (PCM_RUNTIME_CHECK(substream))
         ^
    sound/core/pcm_memory.c:380:26: note: Null pointer dereference
     struct snd_card *card = substream->pcm->card;
                             ^
    sound/core/pcm_memory.c:433:26: warning: Either the condition
    '!substream' is redundant or there is possible null pointer
    dereference: substream. [nullPointerRedundantCheck]
     struct snd_card *card = substream->pcm->card;
                             ^
    sound/core/pcm_memory.c:436:6: note: Assuming that condition
    '!substream' is not redundant
     if (PCM_RUNTIME_CHECK(substream))
         ^
    sound/core/pcm_memory.c:433:26: note: Null pointer dereference
     struct snd_card *card = substream->pcm->card;
                             ^
    Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Link: https://lore.kernel.org/r/20200902212133.30964-4-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    b658cbab
pcm_memory.c 15.1 KB