Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1236289pxa; Thu, 20 Aug 2020 06:24:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOc47XqcOYrorY46tcpseX18PaPpsF52eaS930hmFeNvhwQnxNhAIXdP3nrzbdjj8GBdOW X-Received: by 2002:a17:906:8389:: with SMTP id p9mr3213034ejx.346.1597929866713; Thu, 20 Aug 2020 06:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597929866; cv=none; d=google.com; s=arc-20160816; b=P1X5HphD49Ym6QrGZnnBxsouB5BhvkxX+Q3goKneWdjFY/4tEC7QbgDOnfvOHoRGs8 Vpg8su+qlCursOrOTxECaz9DSoac5zC+MZyf6Y6GUB1gBj8SXgGh4BM4t8jN0796/y+Q VUGruwU7vU02YaQdAURmwTmG2yz0ltQMWfQARNzyrLtKWprAuIsDxsCrg5UgWUtZq7mn O4/u1qdZcsnhL88/kpJW9B7nGnKNCiib1KVsMzbsX36rD+FgWWIaGUUlTtmsIs/AS6Ef EMlVujRosdNtLxGDvVegF9X7+zFUGn1SSl8PO1fiJv/2R1v0jK6E4ph1lnkBgaQRfVtK fduQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h6j1K6n1doOrRYJV8SdM7klrwcZ2IKhIEfV7jcO+r+8=; b=D46/KWZLTd8D3sC7xxWfsAdcmut32es/6qp5VtW+gbKsYYls4Fxt0mcuu0xUPtcTjG S/R2Rrv0BAKouVrOcYTcoo8CgRTflZFINOfni4Y15xK/NrP1oxdpV/Y5Z5VJfUwoHUHF 6k9fXfjZpTT27bEw+GQpIZmg8szXMiJfktzpKP2iNYUyyhVg16aVgEe/fAOb/vTaqQUC C5Q2YkC8teT3W1RR1UfApNOa3ryQpyxmmajVG9dgc98ajtcDe6L9VX9/LFYM3dkzhPOH /qLXqlqU8qDiKagYBLP9BkDs8OXx77S6cx2XtJ+E8tmuAESDSr2dRrtIsEXVfJFo9mTe OLaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tdgrSbV3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p12si1203261edi.348.2020.08.20.06.24.01; Thu, 20 Aug 2020 06:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tdgrSbV3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730765AbgHTNXS (ORCPT + 99 others); Thu, 20 Aug 2020 09:23:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:46306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728445AbgHTJeJ (ORCPT ); Thu, 20 Aug 2020 05:34:09 -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 1396D22BEA; Thu, 20 Aug 2020 09:33:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916016; bh=+2rkOLTAojPpciCsfnRQKWhqYJpIMKTSKUdmYJd/ZrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tdgrSbV39mPTGSZiObH+wrl1v++OXQsTVXt7zvZNjFIz560lIIA7jDRSSOPA8vSx0 eN8+xidLKNkQ4GEoFXbEe5Ci/efsd83ImqDXjQ0P4D56mKD361RCe2/aMlEYdmgM5J z+cNKe8JlKDrdbNFEdsXhLYEpfDR9wzDp7pQ3uHU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Takashi Iwai , Sasha Levin Subject: [PATCH 5.8 214/232] ALSA: echoaudio: Fix potential Oops in snd_echo_resume() Date: Thu, 20 Aug 2020 11:21:05 +0200 Message-Id: <20200820091623.161937546@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit 5a25de6df789cc805a9b8ba7ab5deef5067af47e ] Freeing chip on error may lead to an Oops at the next time the system goes to resume. Fix this by removing all snd_echo_free() calls on error. Fixes: 47b5d028fdce8 ("ALSA: Echoaudio - Add suspend support #2") Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20200813074632.17022-1-dinghao.liu@zju.edu.cn Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/echoaudio/echoaudio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 0941a7a17623a..456219a665a79 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c @@ -2158,7 +2158,6 @@ static int snd_echo_resume(struct device *dev) if (err < 0) { kfree(commpage_bak); dev_err(dev, "resume init_hw err=%d\n", err); - snd_echo_free(chip); return err; } @@ -2185,7 +2184,6 @@ static int snd_echo_resume(struct device *dev) if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED, KBUILD_MODNAME, chip)) { dev_err(chip->card->dev, "cannot grab irq\n"); - snd_echo_free(chip); return -EBUSY; } chip->irq = pci->irq; -- 2.25.1