From patchwork Mon Sep 21 16:27:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263686 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F7F2C43468 for ; Mon, 21 Sep 2020 16:44:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF23723A1B for ; Mon, 21 Sep 2020 16:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706676; bh=4v8q9J/9fwWug1dfX+6rl1pBaG1KGfGEq1QFjK0EsXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ERcrV458AKUWfHQpQWEQcGHN/emYZ3MruTU+yD1uDJpcPH5UPzxDWTWvAM9oKwCpl iPBzD9dBXeQJwJFk/DAtmuoWCTgKNLbgw95FOn2XRQcVmZKze/ovq2otT74wXXKlxV V05hMhdhYE78Jw2K38akBVtpo95iE5OTm/vIwpfs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729448AbgIUQof (ORCPT ); Mon, 21 Sep 2020 12:44:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:49248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729670AbgIUQoJ (ORCPT ); Mon, 21 Sep 2020 12:44:09 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 18BDF23998; Mon, 21 Sep 2020 16:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706648; bh=4v8q9J/9fwWug1dfX+6rl1pBaG1KGfGEq1QFjK0EsXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HHNRx92Pj+wwo2+ajxcKL5s83ihAEyoImXqpQzgHfItUXcfRuVA74OeyerwiXJMI0 nTmB2ZVp7BCwuacD6TPE9onitYvtHRemTPtypO3M7aZ2dsk/eKeIso2KWGxWp9cZf8 1GNBGzx36jgJ++VJJRa54ivMHYlnOYDZ2ZTKSWvE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mateusz Gorski , Kai Vehmanen , Mark Brown , Sasha Levin Subject: [PATCH 5.8 038/118] ASoC: Intel: skl_hda_dsp_generic: Fix NULLptr dereference in autosuspend delay Date: Mon, 21 Sep 2020 18:27:30 +0200 Message-Id: <20200921162038.067119767@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mateusz Gorski [ Upstream commit 5610921a4435ef45c33702073e64f835f3dca7f1 ] Different modules for HDMI codec are used depending on the "hda_codec_use_common_hdmi" option being enabled or not. Driver private context for both of them is different. This leads to null-pointer dereference error when driver tries to set autosuspend delay for HDMI codec while the option is off (hdac_hdmi module is used for HDMI). Change the string in conditional statement to "ehdaudio0D0" to ensure that only the HDAudio codec is handled by this function. Fixes: 5bf73b1b1dec ("ASoC: intel/skl/hda - fix oops on systems without i915 audio codec") Signed-off-by: Mateusz Gorski Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200722173524.30161-1-mateusz.gorski@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/boards/skl_hda_dsp_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c index ca4900036ead9..bc50eda297ab7 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_generic.c +++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c @@ -181,7 +181,7 @@ static void skl_set_hda_codec_autosuspend_delay(struct snd_soc_card *card) struct snd_soc_dai *dai; for_each_card_rtds(card, rtd) { - if (!strstr(rtd->dai_link->codecs->name, "ehdaudio")) + if (!strstr(rtd->dai_link->codecs->name, "ehdaudio0D0")) continue; dai = asoc_rtd_to_codec(rtd, 0); hda_pvt = snd_soc_component_get_drvdata(dai->component);