Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6242119imu; Sun, 2 Dec 2018 13:18:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/U5MFArCE73VSuiihqiyfpPimJl1YFaB/JxvMPDVZEaCXgK5RD+YrywrtbCgP473K5Gh/Gt X-Received: by 2002:a65:65c9:: with SMTP id y9mr11525168pgv.438.1543785481551; Sun, 02 Dec 2018 13:18:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543785481; cv=none; d=google.com; s=arc-20160816; b=WXrxF8yz9uNEK/m76m+FIU3niSwwmvaqplew3np6xSU4L78mWPviv0A8Ir7N9UZl/P X0Yk1BHmbFDOXMR+4p8Ne//jnvZBU3ybjHv+VdK4FQpXVVP/mqQwvwxzKIQ+qQRtu19w wbot+Yf205tCIFR4ClKoWrmuTtRyx2CAe6PcPaUwiZ4NTem49WqmcohddTNjuf0W5V6+ i2dcYpsIBLQRe8VRS6tKnjeRGYabLOrXSCh4CLq8HAhqsn/V4uj7THIcdsiO2bhV3aiP kZtjzp3adTVgYYVrFMrH/WmxrmQhUaetQ/HqcB7HfKHCUHKX2ySRikIn+a0HT7VeSTCy ze3g== 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:user-agent:date :in-reply-to:references:message-id:mime-version:to:from:subject; bh=/pcLu7RLoNB5NDxP6Bz3PLXCjky7ngnUqLTqytf5H50=; b=h30NDo1OSeDoi63VfUo0tfyRvlMC/dNytj06vMPgj0Zvh1hbZRPTjhJWMt534AKfWo VHw0vjkxFoBcn/lS7vDcWQwvmTiEepEPgjbW/WI5LtB7oN8TCK73asxnehQ/uynwcgqd z8/FJVVnKMOTXF/lg4xGZ0A6iCgr5t8UlUiPJ8xjBY3e4E9kbRABn13CJ7UAM0XgqZBF i6pZCS4hD/7jkczAw0z7rqOCnv0yzDdQ/HqDhs4kVBNVdhkNEN6ZKkjZhJNKTTeaGDIH Q9cD5CPjNN+C6Zz2WT4hS7kW+WwMd9mpA6xODPZ6X5mutDywoKIJfckjOS9EUGXaSGM7 f5Vg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si11890259pfn.111.2018.12.02.13.17.47; Sun, 02 Dec 2018 13:18:01 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725846AbeLBVPs (ORCPT + 99 others); Sun, 2 Dec 2018 16:15:48 -0500 Received: from www17.your-server.de ([213.133.104.17]:57632 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbeLBVPs (ORCPT ); Sun, 2 Dec 2018 16:15:48 -0500 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www17.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1gTYlw-00017c-JN; Sun, 02 Dec 2018 21:55:24 +0100 Received: from [2a02:908:4c28:3f60:fff6:43c5:695c:41d6] (helo=localhost.localdomain) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gTYlw-00038m-Cu; Sun, 02 Dec 2018 21:55:24 +0100 Subject: [PATCH] drm/amdgpu: NULL check before some freeing functions is not needed. From: Thomas Meyer To: alexander.deucher@amd.com, christian.koenig@amd.com, David1.Zhou@amd.com, airlied@linux.ie, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 X-Patch: Cocci X-Mailer: DiffSplit Message-ID: <1543760930051-1905796531-2-diffsplit-thomas@m3y3r.de> References: <1543760930050-1499171309-0-diffsplit-thomas@m3y3r.de> In-Reply-To: <1543760930050-1499171309-0-diffsplit-thomas@m3y3r.de> X-Serial-No: 2 Date: Sun, 02 Dec 2018 21:52:11 +0100 User-Agent: Evolution 3.30.2 (3.30.2-2.fc29) Content-Transfer-Encoding: 7bit X-Authenticated-Sender: thomas@m3y3r.de X-Virus-Scanned: Clear (ClamAV 0.100.2/25173/Sun Dec 2 15:13:44 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NULL check before some freeing functions is not needed. Signed-off-by: Thomas Meyer --- diff -u -p a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -816,6 +816,5 @@ out: void amdgpu_acpi_fini(struct amdgpu_device *adev) { unregister_acpi_notifier(&adev->acpi_nb); - if (adev->atif) - kfree(adev->atif); + kfree(adev->atif); }