Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1376265rdh; Fri, 24 Nov 2023 10:59:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlJg3JQ3sLdRb5cyLFVJizPifCzfARyAAjNlhis3t6kQ9D7j54AqYK/qFp8pVpum2ZUtnL X-Received: by 2002:a05:6a20:430d:b0:181:6b3d:ca1c with SMTP id h13-20020a056a20430d00b001816b3dca1cmr9083637pzk.3.1700852398754; Fri, 24 Nov 2023 10:59:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700852398; cv=none; d=google.com; s=arc-20160816; b=GOxzbGx06UiP0XDqyzmbGcaO/XQil/fChI/m8rkSaDZyBS2kLfzB06JxdmmNFFgUdq 06NvhhCfn6s6s/5tu/nFzKX0EqVG7L6+Rb/kJn/quakoFkinLaHID44NsWtM6RcP8ZDD wqQBKs4SnCRGUntzE17pGVnHsG4FhEiUVVHH3kuwjj02fG1O621fkgEFhIIfLbjDfuIG CNXZs5gVc9jN0msm+FY3jwNw7elhrdXeI9Cn7uZjqQgkcPCSgViJPBOvcUZ9Tc31WTvw 727ONoLJur2BM+fWGZ9r+eRyl1hctpEFByKSkvuCWm/cT78Y6qaZ7SZ+EftvoBgbEXjV +HTA== 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=HzhYK8lHpIDWKJworswybUPN7IM2r64lQYnsK378x8M=; fh=Cucz9/MPBGuqQUoND1yvlnWnpKPd9OKEcKkR15flZ+8=; b=poW3TcErbHG8cMYQsP7+2o9rj1pUUHnwtvJNGdmLaJt8EobRfPxxb4BSmqqB4/cgjB BQOMnTQu5sNbO8a2A4GmIi8AwHPnbACwieXhB67WlUbPxYHDxLbwWpZ58C47adkZWnFB 72yPe08uDneCcnCYVePXImSMt/EeiVELssSgy9Io7Fs6EGFqMxIeYkkPGTPIdUfyiBnb js2EQt4mX1J1ZRHeheRi91syU2LAtiufYVQYvzW3QwPNigLeS1yIy6HXhjUEDEfEwuZ9 dSi6N7F6zviKR6FA5MKknUXDBpcbkZEmgIWxwJbOnlFWYKDaSpYqAd9SSaUNMVnrTc++ zrcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HUq4Oypy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bg6-20020a056a02010600b005c1b30b1b65si4390248pgb.648.2023.11.24.10.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 10:59:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HUq4Oypy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 724A383D1571; Fri, 24 Nov 2023 10:59:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345908AbjKXS7g (ORCPT + 99 others); Fri, 24 Nov 2023 13:59:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345915AbjKXS7e (ORCPT ); Fri, 24 Nov 2023 13:59:34 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27494213C for ; Fri, 24 Nov 2023 10:59:40 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57376C433C8; Fri, 24 Nov 2023 18:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700852379; bh=weAAYLO37DhTk8Y6IZDu25vVE/7zMyHaotCMK8Frhn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HUq4OypyDASVzIy/XOspnS8xvKUAfT+5E2sqMkKFIzuLsqxdU75dRXsI7PXYG3uYU 0SjloS4t8vDJFA6qnQ3kT4Hwjg1iSrwzENJTHh14hCSJwQN9z8uF1oAvQ1EaQtXxkE PNUwlx6Eyd7ZqhS93Fn50TwIaptPLfx2k31lV4Yg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Markus Schneider-Pargmann , Guillaume Ranquet , Bo-Chen Chen , CK Hu , 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 Subject: [PATCH 6.1 325/372] drm/mediatek/dp: fix memory leak on ->get_edid callback error path Date: Fri, 24 Nov 2023 17:51:52 +0000 Message-ID: <20231124172021.215392068@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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 24 Nov 2023 10:59:55 -0800 (PST) 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jani Nikula commit fcaf9761fd5884a64eaac48536f8c27ecfd2e6bc upstream. Setting new_edid to NULL leaks the buffer. Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Cc: Markus Schneider-Pargmann Cc: Guillaume Ranquet Cc: Bo-Chen Chen Cc: CK Hu 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: Guillaume Ranquet Link: https://patchwork.kernel.org/project/dri-devel/patch/20230914131058.2472260-1-jani.nikula@intel.com/ Signed-off-by: Chun-Kuang Hu Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/mediatek/mtk_dp.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -2005,6 +2005,7 @@ static struct edid *mtk_dp_get_edid(stru */ if (mtk_dp_parse_capabilities(mtk_dp)) { drm_err(mtk_dp->drm_dev, "Can't parse capabilities\n"); + kfree(new_edid); new_edid = NULL; }