Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3487851ybn; Fri, 27 Sep 2019 07:07:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi6hNm30hUcB2vu2w4znURhwXm5uk1EVXDwk+sKB14D1/zNDIf/gFLdlpKABHVMi/rHXUu X-Received: by 2002:a05:6402:128c:: with SMTP id w12mr4748886edv.158.1569593247248; Fri, 27 Sep 2019 07:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569593247; cv=none; d=google.com; s=arc-20160816; b=fwUqe/aNR4oXo6/WratOjJErPPJQCpkGnTXmFPsIhurYYZ9f/GKNVEezj6wRs/Z2vB 35tdYmTPz3K6ehF0kdEbXpviGHUk9MphTVxqZZaLSRHWuG+1BprAd7FTw82z4WIykeeM U5bTu8urDjWR+qm0x1CfhyQPwBDpmmnrSjB0D9776CUd0Y1gMHTjwtJLPDdRJGorUagh ZVjHugxznvqX58MzpIyU3MSO5t+Co2VNAioCGNwoDanXgmqqvzJYKqKxgOzGQTXN0ROn UAIEwluvj9u3pcrgppb97nX0oaTF8+bZAFhZHUZDimvExKTsCz9halqpW/L6A73s3BQf 5XDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xi3+ATvXzmXB/Dt4LOoB4YHPPwUJEINFuh3xzYVNUyg=; b=DSKS15F1CfRgZM4JCOsjvz0FDQMhiHTcydTYiEm2VsCTiMbPPjLmwaiMY2/2zs0ajn 9v3eEvMMJOpMa/1VqM9mJ7D5BSZ8Kfaxr/0vvI48MECcG7VykN//BbeAMXDEGlMP+3Vk 9+uKNYoS//F5/bQLQQ1cdNepcYsiV42XRUXJVir4UU0w7YPsYLdbt+tkHeR3S9qn5Uh3 lQtjo6xTOX3nV/zJANkybqEZtP0aYmS5vdvdQuX0DonXbmbgxVSry1YsOD1Vg0TMXVGj vMNjrA0kLapwLX+I6ngAzSkw7NktGF7iUJuPlRqDF+u0gasUZGBI5hcV5j0sQmxPsjfr AM/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o4VyjfsQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w23si50505ejj.214.2019.09.27.07.07.02; Fri, 27 Sep 2019 07:07:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o4VyjfsQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727447AbfI0OGK (ORCPT + 99 others); Fri, 27 Sep 2019 10:06:10 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36229 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727140AbfI0OGJ (ORCPT ); Fri, 27 Sep 2019 10:06:09 -0400 Received: by mail-wm1-f67.google.com with SMTP id m18so6316559wmc.1 for ; Fri, 27 Sep 2019 07:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xi3+ATvXzmXB/Dt4LOoB4YHPPwUJEINFuh3xzYVNUyg=; b=o4VyjfsQmpqzylyql6Fe4TZspDv9dduX8LILxcgo8JecSuLAxMDyXcQlMEJbkxKyR3 cXGOvJ9f6avucRDBIchg/Kf8o22pmQlaYY2yVrAMOsUBTCjK0FX7O/utMefJ+0H1Jvov rfG9JBsp6oXwc/JLRWjT624+YylY3OlLAZO7snD1iVR2efeXRSX47qp8ENgM7dbTW6fK P5X5lPG+v5LPpAhwOFmF0P/X1bE72vJRTyfROT+W+FvlNBzNEKjwsIW8pCKAxQrRt8kY XN6raMwVzVYL8kxyQ1xMr6kp/iSOQWaFXrXzZYAPohe51uGEBGGDECEN2cjNQVLwnEgr wDSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xi3+ATvXzmXB/Dt4LOoB4YHPPwUJEINFuh3xzYVNUyg=; b=spsu9egJ/j3WAB3uxeZqZ9batMaBiQ0mpKccqSTC4BVzV5VDbdWxNOLAAiv2R5ZGnM mYgNQY356iqq/uWEW0BgHnU/rmkvKXbtzXkPjhrMGEqVs3vWfsIrOhnjDoFSKajWqRsD ij7sZ0nQtffgFEgGdtgMHmSx0miDeyax/tsrvwUXE4fTozupdYg8L4L+zBROm3t+c1s9 U4sJWIRWWc4hkMRvSdD3hOZNKanLGb0wRhACexc7ngoTx+WeAFFSq2iUq0aJnBC1/ok+ FYw1kV97wzxuGwK7rhbe16xI2HZDMwIstUmL2pt1E2qpXK5kcFHxtf2ywCLMn+OAUhM1 V+OA== X-Gm-Message-State: APjAAAXkvSO7rX6CjeeO7wP9PFEmX/JocKnQBPXZyqk1ZWKaE+DGWCCZ ILtmR6mrsQvmL0gwbDylX/SFqZXS+54XZFh2CPA= X-Received: by 2002:a1c:7d92:: with SMTP id y140mr7325631wmc.141.1569593166157; Fri, 27 Sep 2019 07:06:06 -0700 (PDT) MIME-Version: 1.0 References: <20190926225122.31455-1-lyude@redhat.com> <20190926225122.31455-3-lyude@redhat.com> In-Reply-To: <20190926225122.31455-3-lyude@redhat.com> From: Alex Deucher Date: Fri, 27 Sep 2019 10:05:54 -0400 Message-ID: Subject: Re: [PATCH 2/6] drm/amdgpu/dm/mst: Remove unnecessary NULL check To: Lyude Paul Cc: amd-gfx list , "David (ChunMing) Zhou" , Thomas Lim , Leo Li , David Francis , LKML , Maling list - DRI developers , Nicholas Kazlauskas , David Airlie , "Jerry (Fangzhi) Zuo" , Daniel Vetter , Alex Deucher , Harry Wentland , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 26, 2019 at 6:52 PM Lyude Paul wrote: > > kfree() checks this automatically. > > Signed-off-by: Lyude Paul Reviewed-by: Alex Deucher And applied. Thanks! Alex > --- > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c > index 185bf0e2bda2..a398ddd1f306 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c > @@ -144,10 +144,8 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector) > struct amdgpu_dm_connector *amdgpu_dm_connector = to_amdgpu_dm_connector(connector); > struct amdgpu_encoder *amdgpu_encoder = amdgpu_dm_connector->mst_encoder; > > - if (amdgpu_dm_connector->edid) { > - kfree(amdgpu_dm_connector->edid); > - amdgpu_dm_connector->edid = NULL; > - } > + kfree(amdgpu_dm_connector->edid); > + amdgpu_dm_connector->edid = NULL; > > drm_encoder_cleanup(&amdgpu_encoder->base); > kfree(amdgpu_encoder); > -- > 2.21.0 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx