[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 44/53: mach-defpager: fix warning about uninitialized variable
From: |
Samuel Thibault |
Subject: |
[hurd] 44/53: mach-defpager: fix warning about uninitialized variable |
Date: |
Thu, 20 Mar 2014 02:23:52 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 3deb2d7685f9e9b502a992491f747c3a657e4d15
Author: Justus Winter <address@hidden>
Date: Wed Mar 12 13:10:04 2014 +0100
mach-defpager: fix warning about uninitialized variable
Previously, failure to look up the given partition was detected after
the loop by checking whether the loop ran over all existing
partitions. Initialize part to NULL and check for that instead. This
retains the behavior, but expresses it in a way the compiler
understands better.
* mach-defpager/default_pager.c (destroy_paging_partition): Initialize
part to NULL and check for it still being NULL after the loop.
---
mach-defpager/default_pager.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index 33d72b3..1b9d511 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -1991,7 +1991,7 @@ destroy_paging_partition(name, pp_private)
void **pp_private;
{
unsigned int id = part_id(name);
- partition_t part;
+ partition_t part = NULL;
boolean_t all_ok = TRUE;
default_pager_t entry;
int pindex;
@@ -2006,7 +2006,7 @@ destroy_paging_partition(name, pp_private)
part = partition_of(pindex);
if (part && (part->id == id)) break;
}
- if (pindex == all_partitions.n_partitions) {
+ if (! part) {
pthread_mutex_unlock(&all_partitions.lock);
return KERN_INVALID_ARGUMENT;
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (a3ffccc -> c6f5e3e), Samuel Thibault, 2014/03/19
- [hurd] 28/53: trans/mtab: do not map unknown source strings to "none", Samuel Thibault, 2014/03/19
- [hurd] 34/53: hurd: add IIOCTL_IMPORTS, Samuel Thibault, 2014/03/19
- [hurd] 48/53: Fix crash on opening /dev/kbd or mouse without any console being active, Samuel Thibault, 2014/03/19
- [hurd] 44/53: mach-defpager: fix warning about uninitialized variable,
Samuel Thibault <=
- [hurd] 38/53: trans/ifsock: fix receiver lookup, Samuel Thibault, 2014/03/19
- [hurd] 40/53: mach-defpager: remove comments around form feeds, Samuel Thibault, 2014/03/19
- [hurd] 45/53: mach-defpager: fix warnings about uninitialized variables, Samuel Thibault, 2014/03/19
- [hurd] 41/53: mach-defpager: fix warnings about unused variables, Samuel Thibault, 2014/03/19
- [hurd] 32/53: pfinet: improve the mig mutator functions, Samuel Thibault, 2014/03/19
- [hurd] 47/53: mach-defpager: silently ignore requests to page to active partition, Samuel Thibault, 2014/03/19
- [hurd] 46/53: mach-defpager: fix type of size arguments, Samuel Thibault, 2014/03/19
- [hurd] 35/53: pfinet: fix receiver lookups in iioctl-ops.c, Samuel Thibault, 2014/03/19
- [hurd] 49/53: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2014/03/19
- [hurd] 30/53: libnetfs: fix receiver lookups in fsys server functions, Samuel Thibault, 2014/03/19