diff options
author | Thomas Haller <thaller@redhat.com> | 2015-05-11 21:58:02 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-06-17 18:47:45 +0200 |
commit | a81830c766eb32caf1ef1e68730e02560dc95d33 (patch) | |
tree | 89556a5de3632ae6097bd382f0e5d5cbe1c2b9a7 | |
parent | faf46ad3163698342bceec7848fc76cee1796c4a (diff) | |
download | NetworkManager-a81830c766eb32caf1ef1e68730e02560dc95d33.tar.gz |
platform/test: fix valgrind warning about NULL arguments to mount()
==21573== Syscall param mount(type) points to unaddressable byte(s)
==21573== at 0x854B9BA: mount (syscall-template.S:81)
==21573== by 0x158922: main (test-common.c:295)
==21573== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==21573==
{
<insert_a_suppression_name_here>
Memcheck:Param
mount(type)
fun:mount
fun:main
}
Fixes: d6aef9c188468224d6e1dd670844c3f0e7482c35
(cherry picked from commit 0d7012faab2f69f508a13fdb41fad0a41c7fdc37)
-rw-r--r-- | src/platform/tests/test-common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/platform/tests/test-common.c b/src/platform/tests/test-common.c index 21773133ee..2d37fb837d 100644 --- a/src/platform/tests/test-common.c +++ b/src/platform/tests/test-common.c @@ -309,7 +309,7 @@ main (int argc, char **argv) /* Mount our /sys instance, so that gudev sees only our devices. * Needs to be read-only, because we don't run udev. */ - if (mount (NULL, "/sys", NULL, MS_SLAVE, NULL) != 0) { + if (mount (NULL, "/sys", "sysfs", MS_SLAVE, NULL) != 0) { errsv = errno; g_error ("mount(\"/\", MS_SLAVE) failed with %s (%d)", strerror (errsv), errsv); } @@ -328,7 +328,7 @@ main (int argc, char **argv) errsv = errno; g_error ("remount(\"/sys/devices\") failed with %s (%d)", strerror (errsv), errsv); } - if (mount ("/sys/devices/devices", "/sys/devices", NULL, MS_BIND, NULL) != 0) { + if (mount ("/sys/devices/devices", "/sys/devices", "sysfs", MS_BIND, NULL) != 0) { errsv = errno; g_error ("mount(\"/sys\") failed with %s (%d)", strerror (errsv), errsv); } |