Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1353915rdh; Fri, 24 Nov 2023 10:23:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+KhiUihwEwGQg51qnRb/TSlOtHmYPnoe0wbKrCVkBM1fYfbb08VlApWgF908TAOjj1k1A X-Received: by 2002:a17:902:c942:b0:1cd:f823:456d with SMTP id i2-20020a170902c94200b001cdf823456dmr4866485pla.20.1700850215183; Fri, 24 Nov 2023 10:23:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700850215; cv=none; d=google.com; s=arc-20160816; b=f9/38qpayqmyZodIDw7tRH+TEInZHkc+HfQd8elHOp5qa5TqKerP+W39DdV5RnQneK jGB9TzrGzdcx4CQ8ADhWY1X0I3HhT6ZcCZeGtq/aAXrOqqonGunVUSQ2v/gLrA2uHPjd OJyjBuNkZtWJwNpPtlrjzDKreOWO/R+5h/INtIfx6U/bGyI/eP7Hmiagh2rvYZQjAqOx /w5R9UQcYFQYiFJvJGi5YRnXoplPLR1HVS6QvDuIShamhmPMXKkKWwahjeM1rOKJYcBM 3XOgKdkLL+DGnLHfyaVSB6h+zJ9DRt05ZsjbH4Bp0YKVw3YeSJWBy4ruWRHvSTzV8R/L pd/g== 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=6ZZ0EpmKryKne2ZzZokw95y2YvrPT8J0VESIZ3accaI=; fh=TVy2XHEG9XhRT8sHU7OuD+5CVMoQ+lLM/SnHHuCjgn0=; b=MS7EWrXnTRiFQe6JHJoSrLpPwNEQH8g0VGr50gTMVIxG+iE2sQJy69EKIUGaVcEyrb 8WZm7wZxxivhbNQ83Ei8qJ1jHsn/KSIQmMK/JXzN9dybYenBIbNVCWvrkWW0/sUXzUw5 6QPbCCb2jr+BTkq954jckO3e4Pe9p4aCSXIX4wcu8uKUR5Z2EwSgOEmDNagWJxB9qcSV TXKxhmpI7lZMix3QRTIwgE8jsyvJAmi8jNUp/XVrkmykRzo7XgcxQznSp003dPQw5CcW 51yComgVHduRsPRZLI65/0GZyQVBBJVnM5r63NFYu79Tqt+ds+hfEV180EC/nwVVegX6 /0yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RTBIhCbQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h1-20020a170902f54100b001cc32df8ecesi4026588plf.513.2023.11.24.10.23.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 10:23:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RTBIhCbQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 7C7DB80B8DE8; Fri, 24 Nov 2023 10:23:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231503AbjKXSXM (ORCPT + 99 others); Fri, 24 Nov 2023 13:23:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231451AbjKXSXK (ORCPT ); Fri, 24 Nov 2023 13:23:10 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 963601FC8 for ; Fri, 24 Nov 2023 10:23:17 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5E07C433C8; Fri, 24 Nov 2023 18:23:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700850197; bh=K4JhJN6LNeMUdrkBh6f5NskHpSSmKibSaOBUvOmqrek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RTBIhCbQ9byI8qFM59bU4bPcmjj4liriCnbATnLnGyM/kI43i6fAqHmPtJFl8saA/ wbaSodFnBCRO4s58INY+aJyrcNRic3p+iYAB7sUMkQPTlAiYHwpOShTu1GN2HAp+xP uE/bKdPZ4uSkxrGYjO9zC3XubkEdxtvlJCXJ73Dk= 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.6 460/530] drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection Date: Fri, 24 Nov 2023 17:50:26 +0000 Message-ID: <20231124172042.082336579@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231124172028.107505484@linuxfoundation.org> References: <20231124172028.107505484@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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 24 Nov 2023 10:23:32 -0800 (PST) 6.6-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 @@ -2034,7 +2034,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_atomic_bridge_chain_pre_enable(bridge, connector->state->state); @@ -2053,7 +2052,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); }