summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-08-08 00:17:51 +0200
committerJames Morris <jmorris@namei.org>2010-08-16 09:18:46 +1000
commit2d0564b835eb79d08c20089bf2ca7d5179d390ae (patch)
treef4c91b97313b9a2fbfec4b64e118ffebb4a25682 /security
parent9aa4553cc261f60a60b307e181f7176524b1612f (diff)
tomoyo: cleanup. don't store bogus pointer
If domain is NULL then &domain->list is a bogus address. Let's leave head->r.domain NULL instead of saving an unusable pointer. This is just a cleanup. The current code always checks head->r.eof before dereferencing head->r.domain. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Diffstat (limited to 'security')
-rw-r--r--security/tomoyo/common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index ef43995119a4..a4dc2d5e4825 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -768,8 +768,10 @@ static bool tomoyo_select_one(struct tomoyo_io_buffer *head, const char *data)
return true; /* Do nothing if open(O_WRONLY). */
memset(&head->r, 0, sizeof(head->r));
head->r.print_this_domain_only = true;
- head->r.eof = !domain;
- head->r.domain = &domain->list;
+ if (domain)
+ head->r.domain = &domain->list;
+ else
+ head->r.eof = 1;
tomoyo_io_printf(head, "# select %s\n", data);
if (domain && domain->is_deleted)
tomoyo_io_printf(head, "# This is a deleted domain.\n");