Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3688182lfo; Mon, 23 May 2022 11:29:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVSfRSQRzhNJpzQjHNXf0jQ+AqeAigdwEekvl0QsMBywA8mH2w66ILJ2nkdKi3ljryMlW1 X-Received: by 2002:a17:902:7c8c:b0:161:f5b4:9aa6 with SMTP id y12-20020a1709027c8c00b00161f5b49aa6mr16511907pll.79.1653330554305; Mon, 23 May 2022 11:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330554; cv=none; d=google.com; s=arc-20160816; b=WIX0eZi4GkFcb6KyOghEPdhaXVpapjhgn7t6e9F6knaYmIJrW3JHec016t3mrPr1wH j0bthvboXH05i9Ah1weYYz/8dTXszIB+1n6KqIay2JiGrdaCxLJaWAFbFfeD9vC21HHI i0Uf1BFjrSqX8e3MzAl9MSUnt9Y+R+Ov7dlsZnDO1b2fknR3TMy7BJBhed/YCg86pt+a kWniVj5SIAxDl/fI5M8vsPdpPwJYMiOuSedPqW4S/WpvQn22gV1QYjF28DgZY7JmSvi4 A522JNguMqmVFHdQFatdcBKxDUAVgoO/z0oaQZcbNasWhbYz1MZiCOC0UVhrpXRSPWTn 3YEw== 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=OVsgCK+KvKI1Pp2v6hM5cha5gE750VHH3a9BV9FBnYo=; b=E3E4zEeOlTmZ+uhdqZT62LZ19rdPjSWlRYCMNaugg+Xo1xSSn04eoySCVt6ILDc1KA pyKyV7Q5OykndE9eEiPVYNU7poN3pcJl8+3cwWVLmVtM4bo4Iv/YCKXUnbA5WSExtYyE f2VeggZByox/yfRpkqhwr2sYS7U6eKfyL4rUqYqlcL+rUGj8pqNr+GgqwVdS0KyJa6+b C4bIiYeiKbcV8Q223NtzeiVFHArbhZTbQ7MzX5ZcL6TWn//d+JlSmDEPR/bTkS3pNelY tpyrWhPazeYW8huLWNF4FWtIM7MIypX8eFlpl1eKuTEI+orb/XcFtxOl9A+jEZBKdfRr H4vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pBkpVYl0; 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 h12-20020a170902f54c00b00153b2d16507si11556910plf.271.2022.05.23.11.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:29:14 -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=pBkpVYl0; 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 13D97C6E57; Mon, 23 May 2022 11:28:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239620AbiEWRPb (ORCPT + 99 others); Mon, 23 May 2022 13:15:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240756AbiEWRMi (ORCPT ); Mon, 23 May 2022 13:12:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56D6A6A016; Mon, 23 May 2022 10:11:55 -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 ams.source.kernel.org (Postfix) with ESMTPS id A5724B811FE; Mon, 23 May 2022 17:11:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02A8EC385AA; Mon, 23 May 2022 17:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325876; bh=Bex4+frImCRPD1WgTYjWBQykj4ze7sH8ElNkop69JK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pBkpVYl0veDJ5R7aIhxyVyM8lyayetv1UC8ptANcmfqlQW2f6izZj1BgHkYtAs9Tj mKRsBH2rv96RiyWL617N/J3zxPTqMFA7H391zz4T665nkyCjeI+PMI+iZEXq2vGaNP ALxCOImts9Ulll6ZAIbQaEK+hR8TfvLzoLaHpsC4= 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.19 16/44] drm/dp/mst: fix a possible memory leak in fetch_monitor_name() Date: Mon, 23 May 2022 19:05:00 +0200 Message-Id: <20220523165756.201186224@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165752.797318097@linuxfoundation.org> References: <20220523165752.797318097@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 @@ -2987,6 +2987,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); } /**