Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753101AbbKPSMK (ORCPT ); Mon, 16 Nov 2015 13:12:10 -0500 Received: from mx4-phx2.redhat.com ([209.132.183.25]:38111 "EHLO mx4-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbbKPSMH (ORCPT ); Mon, 16 Nov 2015 13:12:07 -0500 Date: Mon, 16 Nov 2015 13:11:55 -0500 (EST) From: Bob Peterson To: SF Markus Elfring Cc: Steven Whitehouse , cluster-devel@redhat.com, LKML , kernel-janitors@vger.kernel.org, Julia Lawall Message-ID: <331389501.12200850.1447697515517.JavaMail.zimbra@redhat.com> In-Reply-To: <563A6A22.5000206@users.sourceforge.net> References: <5307CAA2.8060406@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <546B20F0.9040202@users.sourceforge.net> <546B27FF.6080702@redhat.com> <563A6A22.5000206@users.sourceforge.net> Subject: Re: [PATCH] GFS2: Delete an unnecessary check before the function call "iput" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.3.113.27] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF42 (Linux)/8.0.6_GA_5922) Thread-Topic: GFS2: Delete an unnecessary check before the function call "iput" Thread-Index: g2qHzpOe2qSteAX0W14PH0Qhkf9/NQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1308 Lines: 46 ----- Original Message ----- > From: Markus Elfring > Date: Wed, 4 Nov 2015 21:23:43 +0100 > > The iput() function tests whether its argument is NULL and then > returns immediately. Thus the test around the call is not needed. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > fs/gfs2/ops_fstype.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c > index baab99b..1f9de17 100644 > --- a/fs/gfs2/ops_fstype.c > +++ b/fs/gfs2/ops_fstype.c > @@ -910,8 +910,7 @@ fail_qc_i: > fail_ut_i: > iput(sdp->sd_sc_inode); > fail: > - if (pn) > - iput(pn); > + iput(pn); > return error; > } > > -- > 2.6.2 > > -- Hi, Thanks. This is now applied to the for-next branch of the linux-gfs2 tree: https://git.kernel.org/cgit/linux/kernel/git/gfs2/linux-gfs2.git/commit/fs/gfs2?h=for-next&id=6fde22426be6af261816db5941744b8d3c4c7f96 Regards, Bob Peterson Red Hat File Systems -- 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/