diff options
| author | Meng Wang <mwang@codeaurora.org> | 2016-09-02 10:01:50 +0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-09-05 23:13:23 -0700 |
| commit | 0981a7c54f186f2a7b79642c32f7312a6234cbd4 (patch) | |
| tree | 656feb099baa0a05d12834e72e2b412c0ba49aa8 /sound/core/timer.c | |
| parent | 11d6060fffff4b7e87d1cadb5f65dfc7f74332cc (diff) | |
ALSA: timer: check if timer->card is null before using it
NULL check timer->card before use to prevent dereferencing
a NULL pointer.
CRs-Fixed: 1046606
Change-Id: I8e359864508cc2307d9e9619f36c7c08cc3842f9
Signed-off-by: Meng Wang <mwang@codeaurora.org>
Diffstat (limited to 'sound/core/timer.c')
| -rw-r--r-- | sound/core/timer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c index b982d1b089bd..fe48208eefde 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -1121,7 +1121,11 @@ static void snd_timer_proc_read(struct snd_info_entry *entry, mutex_lock(®ister_mutex); list_for_each_entry(timer, &snd_timer_list, device_list) { - if (timer->card && timer->card->shutdown) + if (timer->card == NULL) { + pr_debug("%s: timer->card is NULL\n", __func__); + continue; + } + if (timer->card->shutdown) continue; switch (timer->tmr_class) { case SNDRV_TIMER_CLASS_GLOBAL: |
