All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Bächler" <thomas@archlinux.org>
To: util-linux@vger.kernel.org
Cc: "Thomas Bächler" <thomas@archlinux.org>
Subject: [PATCH] libmount: initialize *root to NULL in mnt_table_get_root_fs
Date: Sun, 16 Feb 2014 14:58:06 +0100	[thread overview]
Message-ID: <1392559086-4010-1-git-send-email-thomas@archlinux.org> (raw)

mnt_table_get_root_fs only works when *root is set to NULL. This
is not only undocumented, but also unintuitive. Fix it by initializing
*root inside mnt_table_get_root_fs.
---
 libmount/src/tab.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 8ae49c8..7a253e8 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -501,6 +501,7 @@ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root)
 	struct libmnt_iter itr;
 	struct libmnt_fs *fs;
 	int root_id = 0;
+	*root = NULL;
 
 	assert(tb);
 	assert(root);
-- 
1.8.5.4


             reply	other threads:[~2014-02-16 13:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-16 13:58 Thomas Bächler [this message]
2014-02-17 12:37 ` [PATCH] libmount: initialize *root to NULL in mnt_table_get_root_fs Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392559086-4010-1-git-send-email-thomas@archlinux.org \
    --to=thomas@archlinux.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.