From: Takashi Iwai Date: Thu, 17 Nov 2005 15:00:01 +0000 (+0100) Subject: [ALSA] ac97 - NULL check in snd_ac97_suspend/resume X-Git-Tag: v2.6.16-rc1~474^2~22^2~3^2~148 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e26e7545e9542425f140cb4c605a7ab5a3b13e00;p=linux-2.6 [ALSA] ac97 - NULL check in snd_ac97_suspend/resume Modules: AC97 Codec Add NULL check in snd_ac97_suspend() and snd_ac97_resume() so that the caller doesn't have to do it by itself. Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 9faeaefc8e..abc83fa85b 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -2186,6 +2186,8 @@ static void snd_ac97_powerdown(struct snd_ac97 *ac97) */ void snd_ac97_suspend(struct snd_ac97 *ac97) { + if (! ac97) + return; if (ac97->build_ops->suspend) ac97->build_ops->suspend(ac97); snd_ac97_powerdown(ac97); @@ -2242,6 +2244,9 @@ void snd_ac97_resume(struct snd_ac97 *ac97) { unsigned long end_time; + if (! ac97) + return; + if (ac97->bus->ops->reset) { ac97->bus->ops->reset(ac97); goto __reset_ready;