aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-05-29 12:35:13 +0200
committerTakashi Iwai <tiwai@suse.de>2015-05-29 12:35:13 +0200
commitec3e5bd9638cae5884715c269ae0f87aadf5395d (patch)
treed2b1630051734dfa436109cfdbc871f0031084f5
parent5192ee82af6580a62c63d57461f4a16ff644cde5 (diff)
downloadhda-emu-ec3e5bd9638cae5884715c269ae0f87aadf5395d.tar.gz
Fix segfault with unbound driver at PM test
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--snd-wrapper.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/snd-wrapper.c b/snd-wrapper.c
index c5bb3f3..ad1f9d9 100644
--- a/snd-wrapper.c
+++ b/snd-wrapper.c
@@ -838,7 +838,8 @@ static void check_resume(struct device *dev)
if (dev->pmcnt > 0 && dev->pmsuspended) {
hda_log(HDA_LOG_INFO, "Codec resuming...\n");
dev->pmsuspended = false;
- dev->driver->pm->runtime_resume(dev);
+ if (dev->driver)
+ dev->driver->pm->runtime_resume(dev);
}
}
@@ -853,7 +854,8 @@ static void check_suspend(struct device *dev)
{
if (!dev->pmcnt && !dev->pmsuspended && dev->pmallow) {
hda_log(HDA_LOG_INFO, "Codec suspending...\n");
- dev->driver->pm->runtime_suspend(dev);
+ if (dev->driver)
+ dev->driver->pm->runtime_suspend(dev);
dev->pmsuspended = true;
}
}