Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932299AbbGPCDf (ORCPT ); Wed, 15 Jul 2015 22:03:35 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55540 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754471AbbGPBKc (ORCPT ); Wed, 15 Jul 2015 21:10:32 -0400 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Peter Ujfalusi , Mark Brown , Kamal Mostafa Subject: [PATCH 3.19.y-ckt 078/251] ASoC: tas2552: Fix kernel crash when the codec is loaded but not part of a card Date: Wed, 15 Jul 2015 18:06:39 -0700 Message-Id: <1437008972-9140-79-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1437008972-9140-1-git-send-email-kamal@canonical.com> References: <1437008972-9140-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.19 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1204 Lines: 40 3.19.8-ckt4 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Ujfalusi commit 80ba2669ec8c3e6517aa935001f6cb8809bf3df4 upstream. If the card is not part of any card the tas_data->codec is NULL since it is set only during snd_soc_codec_driver.probe, which is not yet called. Signed-off-by: Peter Ujfalusi Signed-off-by: Mark Brown Signed-off-by: Kamal Mostafa --- sound/soc/codecs/tas2552.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index ae23acd..a073dc9 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c @@ -120,6 +120,9 @@ static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown) { u8 cfg1_reg; + if (!tas_data->codec) + return; + if (sw_shutdown) cfg1_reg = 0; else -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/