Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6247496imu; Sun, 2 Dec 2018 13:26:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/VAZocgEJ3bB8IfiJLP4uwauf9FDAVjGCX3ZI/Yi0hyvkJFmS7B5ybN3mh/gP3RYt35F6uD X-Received: by 2002:a17:902:6b83:: with SMTP id p3mr13431899plk.118.1543785963299; Sun, 02 Dec 2018 13:26:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543785963; cv=none; d=google.com; s=arc-20160816; b=awNYG3P7dUhlVLX5LiZLkMSbl6ngoTFsXKWPMFq2BZ/uzOyV+pd6uV4msjxv4x90yZ 0gUZAavdSsVgN7QCYMZvFJDBOiLuv7j2g6jM4dElMXUIyl8OiNQSRB1alV/yhICqHi3X zSOdsoo1BW7a7CaRYfFkTv3/0rgExbIWPu87QMT9W2NcrnsrlUhbsR0x93YrpHX/rMih TGzq3fcIruSJO4i4fddzXNh4I6KhfP9wVE3fJR1PvlLNyTvn8rYzX+taKru6rXRPW+wZ HWs27q56v8MxCABn/Y6y1Hjg3sYKO+5B5IMFWUE9PD8Rj1pF4beQQPB7jv05XqjZxPz3 9j5w== 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=NTmTuOUC5UdP8SnNxRT0229lm9CjC7tyU3RSAPC9yA4=; b=CUaovnfM2XfBTozQ/jPZ5GBFOv/cLL0g7E2sHyThsplkDkbEhx6PkagEG6J4+3xemx ZERYFzIDKsQkqvNN29JlWF0sUoJr2XM+bWuMU9vVz0RQY0af5zy/tB97s4MtM1ncuCq4 5o/psUoSWUVnt7/HAsoDPSCCfg0aYTMhCHSVpQKv9/J82U2BEO68phhOx71pce0w1d+z Os499SPXK6sX9dLCgvtnY2aoXAzm+xBlXRzsHj6VoMZzBpO102dvTrl2Sbf3x9fwcAvt xF5dhXV0HY2N6CViGi43h4SipomWscxRoIz7trYenQMUbe7zANjBpTcVy6hZ4yC6mvWb O8Jg== 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 v69si10839361pgb.3.2018.12.02.13.25.48; Sun, 02 Dec 2018 13:26:03 -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 S1726010AbeLBVYu (ORCPT + 99 others); Sun, 2 Dec 2018 16:24:50 -0500 Received: from www17.your-server.de ([213.133.104.17]:60456 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725778AbeLBVYt (ORCPT ); Sun, 2 Dec 2018 16:24:49 -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 1gTYls-00016j-4U; Sun, 02 Dec 2018 21:55:20 +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 1gTYlr-0002qq-V9; Sun, 02 Dec 2018 21:55:20 +0100 Subject: [PATCH] dlm: NULL check before some freeing functions is not needed. From: Thomas Meyer To: ccaulfie@redhat.com, teigland@redhat.com, cluster-devel@redhat.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 X-Patch: Cocci X-Mailer: DiffSplit Message-ID: <1543760930052-876371194-16-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: 16 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/fs/dlm/lockspace.c b/fs/dlm/lockspace.c --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c @@ -681,8 +681,7 @@ static int new_lockspace(const char *nam out_lkbidr: idr_destroy(&ls->ls_lkbidr); for (i = 0; i < DLM_REMOVE_NAMES_MAX; i++) { - if (ls->ls_remove_names[i]) - kfree(ls->ls_remove_names[i]); + kfree(ls->ls_remove_names[i]); } out_rsbtbl: vfree(ls->ls_rsbtbl);