Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp130758iob; Tue, 17 May 2022 21:15:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWpCdKVVIhjFcpcYQTlSu42O2QflxcY0x2+Wi4JUXccQD3CptJ/FGt26mtS4czfjbWE1A7 X-Received: by 2002:a17:902:8605:b0:15d:10dc:1c6f with SMTP id f5-20020a170902860500b0015d10dc1c6fmr25489838plo.4.1652847355249; Tue, 17 May 2022 21:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652847355; cv=none; d=google.com; s=arc-20160816; b=joexrbFYTvs3Go3jZ7CKBEApVGSLwDbcruklhO9aG7+2jU1Ik9GmNtPzV2YP36P9BL i8aylN0ekLZXpSFrpYAOlQOHdcIJdz4+ZxgSJjrvWmJvZMpftbsW783dIqHZkTBcFh1L hpMNH6Q6sJJax0UZFv5C4DMk5JBuHS2suFyUe4MSLjrJWFdWhulmvIyndsBWHkW/OB5e z86F+rJpWYYfQ+7uM4PmY0KQVFOSKCwFUUh5MRYxYq0l8tx4AUBaozhwGcR908V2x4R7 5+OgCdKCcEHcGtrZRfKECZ3k4f49PhoP7OIA/fSWjL4tr4SeGc2OLI17NFXumpbcMvDJ 30dw== 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:organization:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=HwEpCwWlcxdGpOh2tFBezSPA0lfra9DVTBWTEtNs0uA=; b=q4V6ABmWmNQrgRCFwcMqf4pwNYTx8b/StV1vVmSwkatraeMlOCjJt9E74ARmIteNDo JSCgo2JHAiYBANq/G/Ek2RqTHAT5RQU0nOr0DU6dtluE+59M6/wltDgsuCmhMt+Yj9kR WmxXX471uPuX1W3uQClgtwUJSA5Slz85OOanGuXLc9uO2OpXz4bjXe5RaGFf4iTteOAh WYGw5CYtUnG2ZiTABuC6409uOpN/yUxIIpkB0rmpRrIfSTkL5gifiEzG4se78Yu5Xc8T efZ3UxxGvqy19mIYjZWf9OfQWtIacspXl51AN0Zd8bmBcTxyVGkuRKLMdHMxN9U7Oj3+ Er5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cYQCcyv0; 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=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k187-20020a636fc4000000b003c6aa1dbd4bsi1226512pgc.30.2022.05.17.21.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:15:55 -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=@redhat.com header.s=mimecast20190719 header.b=cYQCcyv0; 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=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E96C37C168; Tue, 17 May 2022 20:44:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346036AbiEQTxF (ORCPT + 99 others); Tue, 17 May 2022 15:53:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234187AbiEQTxD (ORCPT ); Tue, 17 May 2022 15:53:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ADF3F517F1 for ; Tue, 17 May 2022 12:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652817180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HwEpCwWlcxdGpOh2tFBezSPA0lfra9DVTBWTEtNs0uA=; b=cYQCcyv0STn88qos2771zcZmL5rA23B8GhTeORsh+GZJiSTvOZPkb3gb4dOfus6Lj4yX2X L9/CZAEK9nDriuncj6fXgbrbOvEFW3GZ8szFX54qCTQLobs7tIP8yBNWEVB+CkyDFFVwMY AR8E6VW99HS0uoil8QG9Xe9HX5MZaRk= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-572-6GqKLClIOAOuOIrnxxTOSQ-1; Tue, 17 May 2022 15:52:59 -0400 X-MC-Unique: 6GqKLClIOAOuOIrnxxTOSQ-1 Received: by mail-qk1-f199.google.com with SMTP id c84-20020a379a57000000b0069fcf83c373so14452581qke.20 for ; Tue, 17 May 2022 12:52:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=HwEpCwWlcxdGpOh2tFBezSPA0lfra9DVTBWTEtNs0uA=; b=6IXh+KMC1Pp/gvZXS/dyab/m3ViAOTNx/PsnpcekHB29kOB2A4trjgHh79pCgEkrlw xcR3Uu8lvtPq8/BaAau4KKAGnWpaNQ/yQNGr2wxFeuXmI/RoFKQb+wPiLE7r/N7vYijd 5GJL2PymLIAJsY20UHPh+/YnPiN1wj+yL8VUE2a+6urzYU37vvMLmGwTblQhfu4n6UCl tIdL3nrvoDRAc8kIUv+QkbN/8ZoTuTD2Q40z+d2pdjUQf395cafnBopGj/bPQ8DqcMK2 XvdlHuywK+LGx/5GfOhs9gy3di3F0AJyeSCzTVkBK0b5IO0rpHscD43syUjPproCCBmP ubXg== X-Gm-Message-State: AOAM533l2W1sGcI9ThC5nx/ddjq4x8peKZa2xCUUOjkpVEL+dYKpi1xH u+VI5SHsjO9VhMYMrgsiUA/8Rss2wqaXEAwLvflvFu6eidpVUYjKwAH8fEIJuxp8AUeOnPVg8ov yzNJPnfMyNdFfBbHsaCOaWYXC X-Received: by 2002:ac8:7f04:0:b0:2f3:d6d6:8406 with SMTP id f4-20020ac87f04000000b002f3d6d68406mr21140163qtk.509.1652817178777; Tue, 17 May 2022 12:52:58 -0700 (PDT) X-Received: by 2002:ac8:7f04:0:b0:2f3:d6d6:8406 with SMTP id f4-20020ac87f04000000b002f3d6d68406mr21140150qtk.509.1652817178417; Tue, 17 May 2022 12:52:58 -0700 (PDT) Received: from [192.168.8.138] (static-71-184-137-158.bstnma.ftas.verizon.net. [71.184.137.158]) by smtp.gmail.com with ESMTPSA id j63-20020a378742000000b0069fc13ce1efsm61251qkd.32.2022.05.17.12.52.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 12:52:57 -0700 (PDT) Message-ID: <876ef490a577b8af71d1a8d24a55e43616b7d45b.camel@redhat.com> Subject: Re: [PATCH] drm: dp: fix a possible memory leak in fetch_monitor_name() From: Lyude Paul To: Hangyu Hua , airlied@linux.ie, daniel@ffwll.ch, tzimmermann@suse.de, jani.nikula@intel.com, Bhawanpreet.Lakha@amd.com, Wayne.Lin@amd.com Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Tue, 17 May 2022 15:52:56 -0400 In-Reply-To: <20220516032042.13166-1-hbh25y@gmail.com> References: <20220516032042.13166-1-hbh25y@gmail.com> Organization: Red Hat Inc. Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 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=no 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 Reviewed-by: Lyude Paul Will push to the appropriate branch in a bit On Mon, 2022-05-16 at 11:20 +0800, Hangyu Hua wrote: > 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 > --- >  drivers/gpu/drm/dp/drm_dp_mst_topology.c | 1 + >  1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/dp/drm_dp_mst_topology.c > b/drivers/gpu/drm/dp/drm_dp_mst_topology.c > index 11300b53d24f..7a7cc44686f9 100644 > --- a/drivers/gpu/drm/dp/drm_dp_mst_topology.c > +++ b/drivers/gpu/drm/dp/drm_dp_mst_topology.c > @@ -4852,6 +4852,7 @@ static void fetch_monitor_name(struct > drm_dp_mst_topology_mgr *mgr, >   >         mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port); >         drm_edid_get_monitor_name(mst_edid, name, namelen); > +       kfree(mst_edid); >  } >   >  /** -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat