Jesper Juhl | 22 Jun 2012 01:53
Favicon
Gravatar

[PATCH] Btrfs: Ensure va_end() is always called in __btrfs_std_error() and btrfs_printk()

__btrfs_std_error() neglects to call va_end() when doing early return
after testing "if (errno == -EROFS && (sb->s_flags & MS_RDONLY))" and
btrfs_printk() doesn't call va_end() at all.
This patch makes sure that va_end() is always properly called.

Signed-off-by: Jesper Juhl <jj <at> chaosbits.net>
---
 fs/btrfs/super.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 0eb9a4d..8566465 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
 <at>  <at>  -143,7 +143,7  <at>  <at>  void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function,
 	 * under MS_RDONLY, then it is safe here.
 	 */
 	if (errno == -EROFS && (sb->s_flags & MS_RDONLY))
-  		return;
+  		goto out_va_end;

   	errstr = btrfs_decode_error(fs_info, errno, nbuf);
 	if (fmt) {
 <at>  <at>  -164,6 +164,7  <at>  <at>  void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function,
 		save_error_info(fs_info);
 		btrfs_handle_error(fs_info);
 	}
+out_va_end:
 	va_end(args);
 }
(Continue reading)


Gmane