Message ID | 20200810151814.538258256@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=uOiG=BU=vger.kernel.org=stable-owner@kernel.org> 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=-13.0 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 81B88C433E0 for <stable@archiver.kernel.org>; Mon, 10 Aug 2020 15:40:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5858820774 for <stable@archiver.kernel.org>; Mon, 10 Aug 2020 15:40:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597074044; bh=e083/SwxnTJB1VaRxcyAEteqkXRBIia0Z23r4eMPWzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BuVH1uEP+pfIBQOotwOv6WaVgdrvGmpx4v9uscjY0FaH8vjbhK9R6YbM39kSJ4ese qZLwO57/pUQnOylXQ6hFfzT8fT+pA174+S6NDhozef/OarQcoi4TXqEFmS1HWwbM4k fT1QcFmxwV/5XmMHuicbh02jPlek0Blorw8+Ek7k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728409AbgHJPkn (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 10 Aug 2020 11:40:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:56460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728401AbgHJPYA (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 10 Aug 2020 11:24:00 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 9CF3620772; Mon, 10 Aug 2020 15:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597073040; bh=e083/SwxnTJB1VaRxcyAEteqkXRBIia0Z23r4eMPWzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xWQiTpQn4tmkD+rrflV5x50DEm97lHkfOt1nYemc2sr8T7fZECz/HFN77qnNe+fOk 00pZ8NomXIjZb7cpAht51YfFECfZ/kqz1EmyAK++EHMRxHHxQ/Z6yIZJUfgx/xESu5 OFmwyWjSkmnKSx+RAqwU+5/bG03mhr4I34rPiLvc= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>, Ranjani Sridharan <ranjani.sridharan@linux.intel.com>, Takashi Iwai <tiwai@suse.de>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 5.7 46/79] ALSA: hda: fix NULL pointer dereference during suspend Date: Mon, 10 Aug 2020 17:21:05 +0200 Message-Id: <20200810151814.538258256@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200810151812.114485777@linuxfoundation.org> References: <20200810151812.114485777@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 7e3ae4534df91..803978d69e3c4 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -2935,6 +2935,10 @@ static int hda_codec_runtime_suspend(struct device *dev) struct hda_codec *codec = dev_to_hda_codec(dev); unsigned int state; + /* Nothing to do if card registration fails and the component driver never probes */ + if (!codec->card) + return 0; + cancel_delayed_work_sync(&codec->jackpoll_work); state = hda_call_codec_suspend(codec); if (codec->link_down_at_suspend || @@ -2949,6 +2953,10 @@ static int hda_codec_runtime_resume(struct device *dev) { struct hda_codec *codec = dev_to_hda_codec(dev); + /* Nothing to do if card registration fails and the component driver never probes */ + if (!codec->card) + return 0; + codec_display_power(codec, true); snd_hdac_codec_link_up(&codec->core); hda_call_codec_resume(codec);