From: Lihua Yao Date: Wed, 15 Aug 2018 15:20:34 +0000 (+0800) Subject: ALSA: ac97: fix check of pm_runtime_get_sync failure X-Git-Tag: v4.18.7~56 X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7cff00160365d77a96e86b19152cb0f7b1e1a91;p=linux ALSA: ac97: fix check of pm_runtime_get_sync failure commit d15ec0b482ff502e4e19e43d15aa5072e4290199 upstream. pm_runtime_get_sync returns negative on failure. Fixes: 74426fbff66e ("ALSA: ac97: add an ac97 bus") Signed-off-by: Lihua Yao Acked-by: Robert Jarzmik Cc: Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c index 31f858eceffc..c267e44fefa0 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c @@ -503,7 +503,7 @@ static int ac97_bus_remove(struct device *dev) int ret; ret = pm_runtime_get_sync(dev); - if (ret) + if (ret < 0) return ret; ret = adrv->remove(adev);