Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp838460imu; Tue, 11 Dec 2018 08:19:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/XchCqRN+O+8rNsudwr7AsxwUavdxx8l9DNr2TmV1QYDNSjLlYgH3/4gSnxMGu1RkQnT4DB X-Received: by 2002:a62:1043:: with SMTP id y64mr17169727pfi.78.1544545178320; Tue, 11 Dec 2018 08:19:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544545178; cv=none; d=google.com; s=arc-20160816; b=E72pbxyB1dQ3Ae5xUFPzuI3O5e8sBu3wKMN3mw+he8KzAZnKvu84sT5HFSCDC2bcyd 75DlFPP5z6wEI5x9vBvYJdIeCtF3xDYO1NbDCnmOu2vNUIOv0WPIQbcWB6biCPBa7lc5 zAcFTFVsMWLhkYH9z6i3UWA9W5GTQTYyEDHQYI2OiM9cgIknQz3oEEXV59Xf2MSwMfCK Br4pZMVsb3s88kXEwuf9sZrkIS93N8EmTXJLhgUk/LAIViX+LHlvt5s7BvEZTvNgwI3a QzzocoohP674kEkKvOTgcPTHHt7p4BCNCVmsmcZhKaMAaBfKV3/mZvpm3MGj8Iz4IxO8 m27g== 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=wRaMQsDaoRJoi8qBmOxf0UN1QwKx74sN+5BBlmf/PDw=; b=CnP5h+/aRQKaskuomQ4405ZHvlL85lED/tHuuj8G66lMPpy2gifTCb5a1TOCuV7FTM KrKAfbxsgqlCMU1LF0onTfOQHuV/Qk3m0I8BX+61haDDXhKu85kvfZQMXCbRDqjmGarQ NpI+HZ6zljsMfMrM3NEzW0nOxddx6uzKaaBbbFIQTUotlC3QP9uF/1H476yR7xZuvSq1 3UhKbJNu7O2ZQWcEFTpXZlo3t4cTGLBb+z8ul5nmAHgLEbMA9kv6dRGps7zLx9VGdgnb Ey0wFYc5MzobOdGPmwT2TBDv7oBYfKGAHrhYp57Dj2DraBJY4iiGu8b8oukQmVg7Yp3f WJAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UNEu6J6Z; 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 x33si13123830plb.43.2018.12.11.08.19.23; Tue, 11 Dec 2018 08:19:38 -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=UNEu6J6Z; 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 S1728447AbeLKPrB (ORCPT + 99 others); Tue, 11 Dec 2018 10:47:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:35304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727690AbeLKPqz (ORCPT ); Tue, 11 Dec 2018 10:46:55 -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 0634C21104; Tue, 11 Dec 2018 15:46:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543214; bh=Rs4+TYMkjrJzCZR/PP+KaeIdu+CywUrA2iFbqLF7Uxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UNEu6J6Z7iwtDzw1tbQcDQSQhpwEJOTfT5vskoRhbMzdBZq78nrzaMr45ImKkEYJi xAAa94MemR+v1E2pTHbCGkFSJplQGETQScFrow9/eVrB06X9ins9IVUw+L/xFpblQ7 /Nza2zaKkv9+ENA7IHHXQTgrqbOgN9A5K9pntrV0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Sakamoto , Takashi Iwai Subject: [PATCH 4.4 13/91] ALSA: sparc: Fix invalid snd_free_pages() at error path Date: Tue, 11 Dec 2018 16:40:32 +0100 Message-Id: <20181211151606.995125981@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@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 4.4-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);