Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp799560imu; Tue, 11 Dec 2018 07:47:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/WXic/I0ZFgBKyU7E+qqEfPH7Js1Q3PtDXpEbS1m4xOGQPE7KD6ofMrtDdNYQ+g2F8HpEzx X-Received: by 2002:a63:4665:: with SMTP id v37mr15294644pgk.425.1544543225340; Tue, 11 Dec 2018 07:47:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544543225; cv=none; d=google.com; s=arc-20160816; b=qyCMfAhYtrdjm+cTPbwA4v28EdZ7xNtHUudYV1iMO2wesqvu/A0jezlPu+0pPTg3e1 j2p7fF6SJ8zc/Qtdkkqt0WB8mzwHusqzyxE8ELeFEyBNkSUQ8Pkdi3VW6Ux3rJcYmger cgVRjdLfY5uXZS1cwiN9EEutn63e/MPX9KAJ1B8FYWKQyw9jwFEppbWZI0pNPtldKZUw +aXdKVwrBUtTWzUvvEN44peRgjnmLjaEr52FqAKFg5q+Yy9cS6nKXoCd4yDbU/iEw5VJ VkavxsBj1iTghUKbCUsFFGMz0cXBljA9I6SepDEUXXjPRlOTJYBm80d0RTScbrqQ4fcY xBEg== 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=5z2el0RlBwomfKZc+4YyM4O6qLMdXJXCWc7RNwNb1ec=; b=BbKwwPoWF/ffaEZbhDKL+iqyODWKr1l2SdOm50kuWVomSMK1A58l4ICfhDfGJAzBVw 13ib2U3Nh0abIhn0YNvMYvMhYMb04q1sKIJUaBCXO2hK+MU8j9wFI3GDjoWxyR4HFb44 dTXKcFHBBD9oTvPlA004KEOTw8BsdhvOmcwrYmLvtRcjJxu5lKVpldEniRJ54BF353o+ AuUtNkMC6hDFLE4m53mrcLsYVMkpnIuwy/DqtgG4PlSAuHP92hz5FpEHtdCihCy/Aack NG85u2YZ2PzTvIWzxLawsBuo8R5iuxGrzcxsV9txAjqOJPyd5ZcVAc4U1vnKo8MF7+4d R+Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s5saVBMM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19si12437838pgf.573.2018.12.11.07.46.50; Tue, 11 Dec 2018 07:47:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s5saVBMM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727842AbeLKPoY (ORCPT + 99 others); Tue, 11 Dec 2018 10:44:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:60964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727831AbeLKPoV (ORCPT ); Tue, 11 Dec 2018 10:44:21 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 C5D822082F; Tue, 11 Dec 2018 15:44:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543061; bh=r/gkRGtVA1ZkJbfvUkZilPipJzOSgl6VJWyi5YgTsL4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s5saVBMM/yrrDKkSi6HUQ2iySHXXfJM3vbS3jQIecifpXTUF9atagr5br/X8N2mTc CFuIYfryP5d+T1SWM3DnWtrNuXoT48EghMyzZpulDkOalHWPhKBVU6Eb1evny+yVVc X6ZlcA3t40yd8RfyZ80YAzl61QYzOOSmWyqywhd4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Sakamoto , Takashi Iwai Subject: [PATCH 3.18 07/54] ALSA: sparc: Fix invalid snd_free_pages() at error path Date: Tue, 11 Dec 2018 16:40:55 +0100 Message-Id: <20181211151546.383933950@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151546.010073210@linuxfoundation.org> References: <20181211151546.010073210@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai commit 9a20332ab373b1f8f947e0a9c923652b32dab031 upstream. Some spurious calls of snd_free_pages() have been overlooked and remain in the error paths of sparc cs4231 driver code. Since runtime->dma_area is managed by the PCM core helper, we shouldn't release manually. Drop the superfluous calls. Reviewed-by: Takashi Sakamoto Cc: Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/sparc/cs4231.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c @@ -1146,10 +1146,8 @@ static int snd_cs4231_playback_open(stru runtime->hw = snd_cs4231_playback; err = snd_cs4231_open(chip, CS4231_MODE_PLAY); - if (err < 0) { - snd_free_pages(runtime->dma_area, runtime->dma_bytes); + if (err < 0) return err; - } chip->playback_substream = substream; chip->p_periods_sent = 0; snd_pcm_set_sync(substream); @@ -1167,10 +1165,8 @@ static int snd_cs4231_capture_open(struc runtime->hw = snd_cs4231_capture; err = snd_cs4231_open(chip, CS4231_MODE_RECORD); - if (err < 0) { - snd_free_pages(runtime->dma_area, runtime->dma_bytes); + if (err < 0) return err; - } chip->capture_substream = substream; chip->c_periods_sent = 0; snd_pcm_set_sync(substream);