qubes-linux-kernel/patches.fixes/novfs-fix-oops-in-scope-finding

32 lines
775 B
Plaintext
Raw Normal View History

From: Sankar P <psankar@novell.com>
Subject: novfs: fix an oops in novfs scope-finding code
References: bnc#588579
Patch-mainline: no
This patch removes an attempt to dereference a NULL pointer,
on failed memory allocation. The addscope boolean takes care
of the ScopeUserName field's validity.
Signed-off-by: Sankar P <psankar@novell.com>
Acked-by: Jan Kara <jack@suse.cz>
---
fs/novfs/scope.c | 7 +++----
2011-04-19 20:09:59 +00:00
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/fs/novfs/scope.c
+++ b/fs/novfs/scope.c
2011-04-19 20:09:59 +00:00
@@ -170,10 +170,9 @@ static struct novfs_scope_list *Scope_Fi
kfree(scope);
scope = NULL;
}
- }
-
- if (addscope) {
- novfs_add_to_root(scope->ScopeUserName);
+
+ if (scope && addscope)
+ novfs_add_to_root(scope->ScopeUserName);
}
}