Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756643AbdLPBMn (ORCPT ); Fri, 15 Dec 2017 20:12:43 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:40090 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755976AbdLPBMm (ORCPT ); Fri, 15 Dec 2017 20:12:42 -0500 X-Google-Smtp-Source: ACJfBou8bIIOHrl564AmbXbHg4rCqlJSgI7sfFspScengCY6n8Tv3XHzaHa7JwKDD+lNztfC/EYy3w== From: Brian Norris To: Oder Chiou , Bard Liao , Liam Girdwood , Mark Brown Cc: Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Brian Norris Subject: [PATCH for-4.15] ASoC: rt5514: don't assume rt5514 component was "attached" Date: Fri, 15 Dec 2017 17:12:30 -0800 Message-Id: <20171216011230.107527-1-briannorris@chromium.org> X-Mailer: git-send-email 2.15.1.504.g5279b80103-goog Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1188 Lines: 30 I've found that on Google's "Kevin" Chromebook, the rt5514 codec might not be set up completely, yet its device is still present, and therefore its PM suspend/resume is called. This hits a NULL pointer exception, since we never had the chance to set our drvdata pointer. This resolves crashes seen when trying to resume my system. Fixes: e9c50aa6bd39 ("ASoC: rt5514-spi: check irq status to schedule data copy in resume function") Signed-off-by: Brian Norris --- This is a v4.15-rc1 regression sound/soc/codecs/rt5514-spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c index 2df91db765ac..9255afcf2c3a 100644 --- a/sound/soc/codecs/rt5514-spi.c +++ b/sound/soc/codecs/rt5514-spi.c @@ -482,7 +482,7 @@ static int __maybe_unused rt5514_resume(struct device *dev) if (device_may_wakeup(dev)) disable_irq_wake(irq); - if (rt5514_dsp->substream) { + if (rt5514_dsp && rt5514_dsp->substream) { rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf)); if (buf[0] & RT5514_IRQ_STATUS_BIT) rt5514_schedule_copy(rt5514_dsp); -- 2.15.1.504.g5279b80103-goog