Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2116181ioo; Mon, 23 May 2022 10:24:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUjiB2u3kwyxbw0ftVTWZlErN1JLlpI1CdYWeLQoIcxlc9IV+l0wRVa/oJfznpVkUTZiOV X-Received: by 2002:a63:ee46:0:b0:3f6:1b64:7e4 with SMTP id n6-20020a63ee46000000b003f61b6407e4mr21024162pgk.443.1653326644705; Mon, 23 May 2022 10:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326644; cv=none; d=google.com; s=arc-20160816; b=UpKz6t0cdERCOXhZEZbkjiCCVScnevJc47aUctdRGVnBjKuzZlaYpsbmkcxV4wopG4 PIa188DBSav5nevUvEldJSOvfQcYd9tXnxlf9UiWLPhUb6nmCsJghNiXAZOmATY++ZIm Xi8C1j5JPFYXC3syVNpJZjbpfKd7F685aGEXYm1v/aoEfQMO3JUQWXqihPspJWqdQIlm oEZMJfXzzjSrCre7M0PB4YvX9VKQQqKUySLwRa01xmv68nok2BKVro4xc/ZxfSos06js 6UuXueRXWG6nXp2p48F7O0qg2Mk3TJ++67T/qX8iT8f896XJgDq9wvB5nNmZCYw2mUrm Xegg== 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=39zAw2GDUNJlTsdc3RD/JyelwLS3hNCshKmjJB2gjVY=; b=Uijt4/nCQ3nRP7KSNsPYWE7ysupvEZc0F+IlV5/GR6BeCGOpzo5gU7jEx1xytHgIOo Hv1SgOSPzMn0ap65OC4X6XvIPNEBmsuMGCWZ0hRXkJpB7Fb9VdxdJYIovNEHVOAa5Mv5 O7PE9+gY8XSMLTIBinsJaNGKoR2TzecXQFLEd5yQLgcX4t8zXfES67uWro40/jZ4IupU +GmeGRxTOg7TGGOKWGljVCaIIZa/b8UUk6NkA9zluIe3mYPUCX96f97OmF6gG/Eht3n2 q6cKaeUqHOhrGeaAGrPruWPR17hTHk6gy4lWiNz0GMPhWiFSf0rPP9YXgkVPA92QOLOa IDXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SW0ifRfF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id b2-20020a170902b60200b0015415173078si8758328pls.220.2022.05.23.10.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:24:04 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SW0ifRfF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 C6CBF82150; Mon, 23 May 2022 10:23:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240430AbiEWRTp (ORCPT + 99 others); Mon, 23 May 2022 13:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240620AbiEWRQe (ORCPT ); Mon, 23 May 2022 13:16:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5837160C6; Mon, 23 May 2022 10:16:13 -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 2534A61535; Mon, 23 May 2022 17:15:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EF62C34115; Mon, 23 May 2022 17:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326127; bh=fVbpWz7mvtZzq2d/Vrx1QGCm7tLdV6mrBEKJVLAYw64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SW0ifRfFsUuHMUZCR1BN9hFgDrqw9AJglA/g2EnOjrVy4o/QONp1wvBEjQ8lJAsNb hkJanaCpKHrFN/sNR/tH3N1PisqezYMZbp4Pj3QcZoPiqQJeqBmMVLdUPdn7Ki2RCq iWvlgR5YgjJpaNlqmHNZhFejby7QL18bEafyVJrw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangyu Hua , Lyude Paul Subject: [PATCH 5.4 32/68] drm/dp/mst: fix a possible memory leak in fetch_monitor_name() Date: Mon, 23 May 2022 19:04:59 +0200 Message-Id: <20220523165807.924092270@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165802.500642349@linuxfoundation.org> References: <20220523165802.500642349@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 @@ -3657,6 +3657,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); } /**