Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751722AbbBKJ1C (ORCPT ); Wed, 11 Feb 2015 04:27:02 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:58946 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750984AbbBKJ1A (ORCPT ); Wed, 11 Feb 2015 04:27:00 -0500 From: Bas Peters To: ccaulfie@redhat.com, teigland@redhat.com Cc: Bas Peters , cluster-devel@redhat.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] fs: dlm: lockspace.c: removal of unnecessary check before calling kfree() Date: Wed, 11 Feb 2015 10:26:54 +0100 Message-Id: <1423646814-22720-1-git-send-email-baspeters93@gmail.com> X-Mailer: git-send-email 2.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 957 Lines: 32 kfree() checks its argument. It is therefore unnecessary to do this twice. This issue was detected using Coccinelle. Signed-off-by: Bas Peters --- fs/dlm/lockspace.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index f3e7278..b660b93 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c @@ -674,8 +674,7 @@ static int new_lockspace(const char *name, const char *cluster, 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); -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/