Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1377616rdh; Fri, 24 Nov 2023 11:01:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8GU1MmRYMDbO78TkFe3+QJpX46u8jUyuiTc3tY6Di4/P6Yg4Eut7mpe+RfmMkm8u5bhci X-Received: by 2002:a05:6a00:391f:b0:6c3:3213:2d17 with SMTP id fh31-20020a056a00391f00b006c332132d17mr4443582pfb.29.1700852481710; Fri, 24 Nov 2023 11:01:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700852481; cv=none; d=google.com; s=arc-20160816; b=0aQD3ln57DuHYPTaZbhZz2Ov+OKD6+JFlwwh+JhibXr0mQC20BP8EWJ7XcYYpXXLE2 hXB0JR+0QbY+wSG4DVw+6AtTVUex/L42eLSadn5yOuXiMu0eq7N7oY2sEL0Ot2hdf0Ju VOD4P+s1mSB0m5rbBbDUTbMWUvKIthsz94D6Q0WSO/RyBCAOXAtfhuZBs+NyKEtzIk9m 0veXKGfvc60Y2kEEPxwF9VWWn5Qsk40ujDGL9+RZQ8YFRiIQCTfcik5ynmMuYPuY1T3k nNsgbW9M0RTy2FX9PvmE7Bbn1hz1Vmabx+IDSdyPSLXjTxG3fQubyTgWKkFO5zR2BmVR wYxw== 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=ts1KPkibNqcx5zZJ6a5hBrmL+wYch4crvU+NzY+EWt0=; fh=TVy2XHEG9XhRT8sHU7OuD+5CVMoQ+lLM/SnHHuCjgn0=; b=LU7buskHqJVMRId6Eed+nvQmjNR2+y98JSLgqNmpHTPBnHf7X/W2NZMOiCNWTANHzw pqy5ZY1kdPyqcBB04i9CFeHZMg5k3ti4w9GNUh8VKA94fBGz+nP7r6XQgslZmEyyaeF0 j8Vhe9b7ry09lKKKnha/piecom+jVneQvJPXP/zPXvq3Z9p3V5HO6pknQVRLG3AMRSGG xJiIj0Z0YxvlzuN4i6/n+ylFWOT4BPGeTEnolfDAwuR2X3eNkjtJVZiHZc/A0U76hEkM M/vlVbSRP0WU4kbX1xsZC7rcIh0f4wPfupKmFR72RF+T76GNzrL8iTsw9lxXbXV1nrjl Nr3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k7aqIAZT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id x1-20020aa79a41000000b006cb75e19e07si3985275pfj.126.2023.11.24.11.00.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 11:01:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k7aqIAZT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B35108027A58; Fri, 24 Nov 2023 11:00:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231512AbjKXTAg (ORCPT + 99 others); Fri, 24 Nov 2023 14:00:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjKXTAf (ORCPT ); Fri, 24 Nov 2023 14:00:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB633324B for ; Fri, 24 Nov 2023 11:00:41 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 180DCC433C7; Fri, 24 Nov 2023 19:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700852441; bh=IYiTgBZCIQ4urWrEoiZflc24qhP94zYvIAaY9oZy5A8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k7aqIAZTslou2TcgbuGAT8/w/E7AF7BE13c9D1qM0hh0+HPPxtpMt5kUup0zdbYqH 4wt3QSRcTXmEgNXiMBQ+sUH/ZMG3705pTGbo+g1vC1f3TLcGN1QXHbqo8BzB5ZJ94W Qr7AZqcy8ikFLt39HnC8OPbBr5/CZBxo0Bj1C3iQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guillaume Ranquet , Bo-Chen Chen , AngeloGioacchino Del Regno , Dmitry Osipenko , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jani Nikula , Chen-Yu Tsai Subject: [PATCH 6.1 324/372] drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection Date: Fri, 24 Nov 2023 17:51:51 +0000 Message-ID: <20231124172021.182820979@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231124172010.413667921@linuxfoundation.org> References: <20231124172010.413667921@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 24 Nov 2023 11:00:55 -0800 (PST) 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jani Nikula commit dab12fa8d2bd3868cf2de485ed15a3feef28a13d upstream. The sads returned by drm_edid_to_sad() needs to be freed. Fixes: e71a8ebbe086 ("drm/mediatek: dp: Audio support for MT8195") Cc: Guillaume Ranquet Cc: Bo-Chen Chen Cc: AngeloGioacchino Del Regno Cc: Dmitry Osipenko Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: Matthias Brugger Cc: dri-devel@lists.freedesktop.org Cc: linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: # v6.1+ Signed-off-by: Jani Nikula Reviewed-by: Chen-Yu Tsai Link: https://patchwork.kernel.org/project/dri-devel/patch/20230914155317.2511876-1-jani.nikula@intel.com/ Signed-off-by: Chun-Kuang Hu Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/mediatek/mtk_dp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -1983,7 +1983,6 @@ static struct edid *mtk_dp_get_edid(stru bool enabled = mtk_dp->enabled; struct edid *new_edid = NULL; struct mtk_dp_audio_cfg *audio_caps = &mtk_dp->info.audio_cur_cfg; - struct cea_sad *sads; if (!enabled) { drm_bridge_chain_pre_enable(bridge); @@ -2010,7 +2009,11 @@ static struct edid *mtk_dp_get_edid(stru } if (new_edid) { + struct cea_sad *sads; + audio_caps->sad_count = drm_edid_to_sad(new_edid, &sads); + kfree(sads); + audio_caps->detect_monitor = drm_detect_monitor_audio(new_edid); }