Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1775654pxp; Mon, 7 Mar 2022 02:02:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOLcGe+CLn1DUd/87HlePe0tjOrvyG5qkOI7wi/Vg/cs9nCqxKHf5hTDCcJqUsGTQYFIVk X-Received: by 2002:a17:902:db02:b0:151:cf55:83de with SMTP id m2-20020a170902db0200b00151cf5583demr10964346plx.69.1646647368067; Mon, 07 Mar 2022 02:02:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646647368; cv=none; d=google.com; s=arc-20160816; b=ILHdWz4kuwKgVFqn2aOTVIppubOQsY4+v6m++TrNVrCSGMwIWDNUjluoKwBlx1HQNo 8knDIGPI2GqpkrPW6rK7bvem69cl4+LdfzK+tnkoAPANea7jm/v9oGV28oWM0doQl7CR mk5jHKl5uyuSkPDKeK5D4M9rjkeDfXxEAbnuHo98ELAu2LA11aSh58Oe5BOC5nCP/PiR mFMi1KMxUV2DQ8y/2kRgBQ0juhhBVO/GwhD5ebeW8As5AzddeiIyEt7G3VX9ukLlzfY4 FpFzOwQWVdtJMo7ITweiZGGrMQVEu/N6dgJSn/2RQzeGp4x196yBmGKUzzjk8d7Y5Djb NWJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JXajLgUVdT/0cu6jwkZVXQsoKMhCE0BZrfYJIIYQ3xU=; b=cPtoW09HIm7a7/bADKPEjad9tAMLx3eZNWGyLcDkOzCcmQD3voL5OygKLocqPRg+nP 4qdIUsPOFRu4Bc2yOahHrKRIPH54Mf+VuN10seu+01N60tbSZTDoZ42EaKf04AC2VCCt 2nprnluRUgycixr5Yvd89aTT9bDAqqJvvAuJUHx2zjB/ko47IXwD1UpweBF7NRK5XLcC H1vpzei/ttzsLkbR+QNI46Nj1v2x0ZotbxHdMwfHp5joyZUITR/CVHlxl/6gFVj+tdvB 9EqNCrJReekeBOoTqWQjpK1Pk6CGy/e1scWWsugNzFs8mbbFBGfnt48xQ1eriD7Ib9V2 ZCFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yc7a62zE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g18-20020a63fa52000000b003755cc87e8dsi11817526pgk.500.2022.03.07.02.02.33; Mon, 07 Mar 2022 02:02:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yc7a62zE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236882AbiCGJZs (ORCPT + 99 others); Mon, 7 Mar 2022 04:25:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236954AbiCGJXP (ORCPT ); Mon, 7 Mar 2022 04:23:15 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3477366FAD; Mon, 7 Mar 2022 01:21:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BA13361073; Mon, 7 Mar 2022 09:21:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A60B7C340F3; Mon, 7 Mar 2022 09:21:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646644892; bh=IENnOzCQlJp+UBCrUtJmV2Qib/MihkklYG372lOJDsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yc7a62zEZJwo29iOfi+jJwqSH5MfKJLLsYeG0VOFDv2ABCUKhYtXsmcUt26nfCS/r WtrRwhRIJUMNQb/AJVdDQdzAMUq//HIFa2pG4awTdHK32+XJPxckjyjSZSOdasKxpW 2LvptpIKJUJc5BWZkK5wWjlN2mLKfcHszJYJHcdI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhen Ni , Takashi Iwai Subject: [PATCH 4.14 13/42] ALSA: intel_hdmi: Fix reference to PCM buffer address Date: Mon, 7 Mar 2022 10:18:47 +0100 Message-Id: <20220307091636.537139158@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307091636.146155347@linuxfoundation.org> References: <20220307091636.146155347@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhen Ni commit 0aa6b294b312d9710804679abd2c0c8ca52cc2bc upstream. PCM buffers might be allocated dynamically when the buffer preallocation failed or a larger buffer is requested, and it's not guaranteed that substream->dma_buffer points to the actually used buffer. The driver needs to refer to substream->runtime->dma_addr instead for the buffer address. Signed-off-by: Zhen Ni Cc: Link: https://lore.kernel.org/r/20220302074241.30469-1-nizhen@uniontech.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/x86/intel_hdmi_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c @@ -1308,7 +1308,7 @@ static int had_pcm_mmap(struct snd_pcm_s { vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); return remap_pfn_range(vma, vma->vm_start, - substream->dma_buffer.addr >> PAGE_SHIFT, + substream->runtime->dma_addr >> PAGE_SHIFT, vma->vm_end - vma->vm_start, vma->vm_page_prot); }