Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2673654ybn; Thu, 26 Sep 2019 15:54:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrL2t+vvn06477tgrPlTVYyGFViH/5+I+BGGG5SIRRYkmkEUNlktVUATIsJj6tVHHWIEEj X-Received: by 2002:aa7:ce88:: with SMTP id y8mr1371458edv.145.1569538463857; Thu, 26 Sep 2019 15:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569538463; cv=none; d=google.com; s=arc-20160816; b=TFwwfK44u1h6aSIEHft5F7yKJ3rI/jP/P11BwtBB9WYEFrzhv3GMy9U+LZcQauH40A k62kz2zqMbhG27i65vYe6AuXv28z7CXYA4ShVfHBZBUkJV9bbdPgdT9dZkK8k9TvDwvC Ufmqws02Z9hya8bT9d1K9i2m3M1JwLaabGvNKQjgpkv476ti3XjPKcS/SJlDaqHeN7zv PY2sNI6msQn/6vpYEK6hkrae0xmiVNiF4zOR5UZvc2HcMozi2y+s1O6VqlQmiGwHBO/r itwIHJ4a+B+4m1GUd2OKZI+cLsLPXOl+S3+gSapz5OX5zLIMDGSfvnN2bCBvEooQBpI+ OX1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=n15ycmUnP8XG9sjWKNh0S1OB9l/ozBkjurmcYotNmpQ=; b=izCXJZiC7pYbK9sKL6PmcuTnirTMPFUQft2bDWfv2U8pdjVEH9TNKKUGgO92SldRqq BmD2JKOf5U7uPwZJ6/O/pDOAE4m8/Z/1w1JvW/nGdBnVne4sH5lE3CIv90hfMCJJjRFi qAhnCn8fqTsX4XpgD4BmjYW9InpTU7rmP7DutS/DpPReDl2t9QbzwkVc93ez/ox94wNG XFqjjsl6e3iFAO2usYwCae4hXJHkOgQRYuQ08Q4Knew2vIOpXJP85uKHBIr4upuyhN9r 1+mgEDRAgKIcaweb3OmpW5r06oy6QJein52IJO2P6q4zgqQCuJWt/e6quSOsC9VhgIa6 VBuA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20si475131edc.202.2019.09.26.15.54.00; Thu, 26 Sep 2019 15:54:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728585AbfIZWwD (ORCPT + 99 others); Thu, 26 Sep 2019 18:52:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53740 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726084AbfIZWwA (ORCPT ); Thu, 26 Sep 2019 18:52:00 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1409A30832C0; Thu, 26 Sep 2019 22:52:00 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-34.bss.redhat.com [10.20.1.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE1E6600C1; Thu, 26 Sep 2019 22:51:58 +0000 (UTC) From: Lyude Paul To: amd-gfx@lists.freedesktop.org Cc: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "David (ChunMing) Zhou" , David Airlie , Daniel Vetter , "Jerry (Fangzhi) Zuo" , Nicholas Kazlauskas , Thomas Lim , David Francis , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] drm/amdgpu/dm/mst: Remove unnecessary NULL check Date: Thu, 26 Sep 2019 18:51:04 -0400 Message-Id: <20190926225122.31455-3-lyude@redhat.com> In-Reply-To: <20190926225122.31455-1-lyude@redhat.com> References: <20190926225122.31455-1-lyude@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 26 Sep 2019 22:52:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kfree() checks this automatically. Signed-off-by: Lyude Paul --- 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