[Top] [All Lists]

[PATCH 2/8] xfsprogs: unconditionally drop used buffer reference

To: xfs@xxxxxxxxxxx
Subject: [PATCH 2/8] xfsprogs: unconditionally drop used buffer reference
From: Alex Elder <aelder@xxxxxxx>
Date: Thu, 10 Nov 2011 14:35:12 -0600
Cc: Alex Elder <aelder@xxxxxxx>
In-reply-to: <1320957318-16269-1-git-send-email-aelder@xxxxxxx>
In-reply-to: <3ed89446f6dc1231ec1de712f242522052952b7e.1320955675.git.aelder@xxxxxxx>
References: <1320957318-16269-1-git-send-email-aelder@xxxxxxx>
References: <3ed89446f6dc1231ec1de712f242522052952b7e.1320955675.git.aelder@xxxxxxx>
In libxfs_mount(), after reading the last block in the log device,
the buffer is released by a call to libxfs_putbuf().  But it's done
only if bp is non-null.  It always will be non-null at this point,
so just make the call unconditionally.

Also touch up a misleading indent.

Signed-off-by: Alex Elder <aelder@xxxxxxx>
 libxfs/init.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libxfs/init.c b/libxfs/init.c
index 08fc584..ba44c9b 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -743,15 +743,14 @@ libxfs_mount(
                        if (!(flags & LIBXFS_MOUNT_DEBUGGER))
                                return NULL;
-               if (bp)
-                       libxfs_putbuf(bp);
+               libxfs_putbuf(bp);
        /* Initialize realtime fields in the mount structure */
        if (rtmount_init(mp, flags)) {
                fprintf(stderr, _("%s: realtime device init failed\n"),
-                       return NULL;
+               return NULL;
        error = libxfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi);

<Prev in Thread] Current Thread [Next in Thread>