]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix uninitialized warnings in mempolicy.c
authorJesse Barnes <jbarnes@engr.sgi.com>
Tue, 14 Sep 2004 00:51:00 +0000 (17:51 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 14 Sep 2004 00:51:00 +0000 (17:51 -0700)
err may be used uninitialized in mempolicy.c in both compat_set_mempolicy
and compat_mbind.  This patch fixes that by setting them both to 0.

Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/mempolicy.c

index c87295c4b8d07d19bf613ccc0e281d13ace48577..9b59ac453269debedff9139bc8fcee54b2166d7d 100644 (file)
@@ -557,7 +557,7 @@ asmlinkage long compat_get_mempolicy(int __user *policy,
 asmlinkage long compat_set_mempolicy(int mode, compat_ulong_t __user *nmask,
                                     compat_ulong_t maxnode)
 {
-       long err;
+       long err = 0;
        unsigned long __user *nm = NULL;
        unsigned long nr_bits, alloc_size;
        DECLARE_BITMAP(bm, MAX_NUMNODES);
@@ -581,7 +581,7 @@ asmlinkage long compat_mbind(compat_ulong_t start, compat_ulong_t len,
                             compat_ulong_t mode, compat_ulong_t __user *nmask,
                             compat_ulong_t maxnode, compat_ulong_t flags)
 {
-       long err;
+       long err = 0;
        unsigned long __user *nm = NULL;
        unsigned long nr_bits, alloc_size;
        DECLARE_BITMAP(bm, MAX_NUMNODES);