Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1354047rdh; Fri, 24 Nov 2023 10:23:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8AfQ4qpQxnc8n1WRk/7foeLdaIcSntQpmPaNcVg4lYtnJV4t7Dy5ue6EomEC5hANbChuI X-Received: by 2002:a05:6a00:f8d:b0:690:c887:8cd8 with SMTP id ct13-20020a056a000f8d00b00690c8878cd8mr3600358pfb.32.1700850226646; Fri, 24 Nov 2023 10:23:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700850226; cv=none; d=google.com; s=arc-20160816; b=GsZXRH6gxwyJFnFWL4pVSz/JhIU9bR/RCDAIbNAT6JbgKHj6varNmgYSMaXTj4LfAB P8aybLXv3bVtcCu/IjL1geNlVZXS0rXwohV4bDPNxdwuY4s1ty+N1MTY4EkKSqs4rNOe 5dL+/AHsrW3rF8LNbbcoFX3iC3utlTcP6snrkCGGERW/y85OD/TLqQlRQZL1ixkEgoxz 39/PX17EWlIxoHn8C/z14ZJ7lpf4qTOLgyh6TilPQ9aFZ7b/ELsuh/EhOX07oI7LYXMA 8S27w/zUH8VLYe0bQevkzp6X6Y9+TKjzVjxks1f0iaU3ofy2SGATD7hrnHzMqvEyCBMm 4XlA== 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=jwLsUZ2VXB6KES1Xvkr0Tgaw7gJ6oM004jLkX2RHh20=; fh=Cucz9/MPBGuqQUoND1yvlnWnpKPd9OKEcKkR15flZ+8=; b=LkkcNMAtUw03cZZy5EvR4kSqIuAWGFPQsDIRPSnqE9AX3dz8rM/HYjevR/E++cHzkk 5XSWGxdZu7NToeyywWYbDZsraCnT/Fcf4/QoH8GMO+KIAe8gQqvvYMYK9UvcK7JpxYz+ DYmoXpypq1fhS9w/ION/xnEsk+Tq0T5wvWhLPsluYy+32+tinfy+RNAIHef0KGBzfk4O kVLIZi034IgssLeKHHlug0rOlAR/AniOa10Xko0aECHIE2J0QeajY+pWaJSwCnbJQ50q 1hr8Nd3dQrojAq8DfRcuOng7IAsgG+zYJF+UUY1abQOjI/47OFWTeMoSg1k4QHU+/v/k AfZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OUCmicEQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id a6-20020a654186000000b005ad5178d053si3930332pgq.347.2023.11.24.10.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 10:23:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OUCmicEQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id EAC7A80473F6; Fri, 24 Nov 2023 10:23:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345407AbjKXSXP (ORCPT + 99 others); Fri, 24 Nov 2023 13:23:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231510AbjKXSXN (ORCPT ); Fri, 24 Nov 2023 13:23:13 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0850F1FD9 for ; Fri, 24 Nov 2023 10:23:20 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C45EC433C7; Fri, 24 Nov 2023 18:23:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700850199; bh=TQigOJeeiIsuFOQ5y89JEmF1tl/wtTbF5FuX0ji1AEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OUCmicEQdnyHZRxzyNPpvcQ4XwvAu4naPDWYXhLld93S0zfjNzvaUhfVGTigqnqB6 MfkwTsknpHhDmbIdn6Z+kpS3JuVnjfTuk9fQ/IKOzu5cQ4Vl4xOturZw9tbcN47JT9 R8UACDYQydJdyTQcbFRdIvq/IBNVLrCnt9v503B4= 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.6 461/530] drm/mediatek/dp: fix memory leak on ->get_edid callback error path Date: Fri, 24 Nov 2023 17:50:27 +0000 Message-ID: <20231124172042.114754442@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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 24 Nov 2023 10:23:44 -0800 (PST) 6.6-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 @@ -2048,6 +2048,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; }