Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2107993ioo; Mon, 23 May 2022 10:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTqzbgwDPG2ykd0XV6Rj6Y0zq2/Nr8V2DO8woeRTLue1p3Se99iCSyYpvN5jZBj+XabI7I X-Received: by 2002:a63:5:0:b0:3c6:dcb2:428 with SMTP id 5-20020a630005000000b003c6dcb20428mr20978753pga.73.1653326000098; Mon, 23 May 2022 10:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326000; cv=none; d=google.com; s=arc-20160816; b=T0AcTUfyDG56VfeNtMcSBfh2kKU8hO6JE7sosG1k+f84Avf2YrnM/V0JcBXjuiT6D5 1rKGCrUHaUrqL8v9vmAdAhEdUyZ67BxyRekAJ2KKQZnQsAtVwOp3IQGgG+93DEN78uOy c/mnikmiOaCNiUS5JfgS5o1HAgGihm1A5AGsxNRmHXiy4SUdytc4211kxkN+Ou+eOvPE B+vHW0RVIOGacB9jopkXNPfA/q2jdtgEX1lXsLiMr+wKshqnG56Bls+DXe1YFYCwO7Qi lLQ6NO9n2ERa+XmEBtnnN2Vf79lPAfSVkZhs5eGlHtgmOVlS4EIwJvQd6/5R6k7mspHs 4yfQ== 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=6YMMh3218AOIrU1+pXvCIgFJzAE6YTpPdmYIYBnOd+c=; b=wkLMv/0HOyGycQp5+/XfJoto34f2dU42LUGgx8C8/8UZO7Vz+TmIMnrR8egbRsQduR vQ1N2F45SGiPPqlWec2sCv1lKOV33+YtoAqwCV45qhH4RKVM6o0e1gH6DRH14k+aHUCI C8qM1pZzPNlas28uMftO3aWDCxuBzAb3ZcwxrxU6zYLXLAMW+vxKXxXa425hz8r33h0+ vb/KGWDc1srebKgn6M4aGTbmcTHtzP+VaR5pcWUeQTZXUmveOtOy0GDMVRlRAunphueP 9iBk3G9QFH8V6YRcWwYQstokhmPABBm6g5yDbjY2fkpdVK6eWs7KSGYtwVXZBR6EHLEr s7gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yBXYVV4x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id oc10-20020a17090b1c0a00b001c7511dc330si16068434pjb.167.2022.05.23.10.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yBXYVV4x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 35E846D944; Mon, 23 May 2022 10:13:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239701AbiEWRJg (ORCPT + 99 others); Mon, 23 May 2022 13:09:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239450AbiEWRJQ (ORCPT ); Mon, 23 May 2022 13:09:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CBBA6C54E; Mon, 23 May 2022 10:08:43 -0700 (PDT) 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 95E9D614CA; Mon, 23 May 2022 17:08:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78D14C385A9; Mon, 23 May 2022 17:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325708; bh=ftxdWj3rbiElIFxqTAQAWauSR4gy98WNczgs3M9/a0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yBXYVV4xbiXnlTS1VlczQQpyJrWur5tJpvQgMnPt7cWD/WPUrXh8uv/6+2lveaEvN 3mAVas7VkinNOaCP671grRd3NuoKHgCeoC1FZEcy2eJ96EESwGklINl6wlCfS0Gj0w ACx1kvHdZDxm7RUvvp3DRwO/PSgn7SXcLVBjY1mI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangyu Hua , Lyude Paul Subject: [PATCH 4.14 10/33] drm/dp/mst: fix a possible memory leak in fetch_monitor_name() Date: Mon, 23 May 2022 19:04:59 +0200 Message-Id: <20220523165748.819779721@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165746.957506211@linuxfoundation.org> References: <20220523165746.957506211@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=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hangyu Hua commit 6e03b13cc7d9427c2c77feed1549191015615202 upstream. drm_dp_mst_get_edid call kmemdup to create mst_edid. So mst_edid need to be freed after use. Signed-off-by: Hangyu Hua Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20220516032042.13166-1-hbh25y@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_dp_mst_topology.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2910,6 +2910,7 @@ static void fetch_monitor_name(struct dr mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port); drm_edid_get_monitor_name(mst_edid, name, namelen); + kfree(mst_edid); } /**