diff options
Diffstat (limited to 'security/tomoyo/common.c')
-rw-r--r-- | security/tomoyo/common.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index e331e699cf54..ef6622300a81 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c | |||
@@ -750,7 +750,7 @@ bool tomoyo_io_printf(struct tomoyo_io_buffer *head, const char *fmt, ...) | |||
750 | * | 750 | * |
751 | * Returns the tomoyo_realpath() of current process on success, NULL otherwise. | 751 | * Returns the tomoyo_realpath() of current process on success, NULL otherwise. |
752 | * | 752 | * |
753 | * This function uses tomoyo_alloc(), so the caller must call tomoyo_free() | 753 | * This function uses kzalloc(), so the caller must call kfree() |
754 | * if this function didn't return NULL. | 754 | * if this function didn't return NULL. |
755 | */ | 755 | */ |
756 | static const char *tomoyo_get_exe(void) | 756 | static const char *tomoyo_get_exe(void) |
@@ -1248,7 +1248,7 @@ static bool tomoyo_is_policy_manager(void) | |||
1248 | last_pid = pid; | 1248 | last_pid = pid; |
1249 | } | 1249 | } |
1250 | } | 1250 | } |
1251 | tomoyo_free(exe); | 1251 | kfree(exe); |
1252 | return found; | 1252 | return found; |
1253 | } | 1253 | } |
1254 | 1254 | ||
@@ -1931,7 +1931,7 @@ static int tomoyo_read_self_domain(struct tomoyo_io_buffer *head) | |||
1931 | */ | 1931 | */ |
1932 | static int tomoyo_open_control(const u8 type, struct file *file) | 1932 | static int tomoyo_open_control(const u8 type, struct file *file) |
1933 | { | 1933 | { |
1934 | struct tomoyo_io_buffer *head = tomoyo_alloc(sizeof(*head)); | 1934 | struct tomoyo_io_buffer *head = kzalloc(sizeof(*head), GFP_KERNEL); |
1935 | 1935 | ||
1936 | if (!head) | 1936 | if (!head) |
1937 | return -ENOMEM; | 1937 | return -ENOMEM; |
@@ -1992,9 +1992,9 @@ static int tomoyo_open_control(const u8 type, struct file *file) | |||
1992 | } else { | 1992 | } else { |
1993 | if (!head->readbuf_size) | 1993 | if (!head->readbuf_size) |
1994 | head->readbuf_size = 4096 * 2; | 1994 | head->readbuf_size = 4096 * 2; |
1995 | head->read_buf = tomoyo_alloc(head->readbuf_size); | 1995 | head->read_buf = kzalloc(head->readbuf_size, GFP_KERNEL); |
1996 | if (!head->read_buf) { | 1996 | if (!head->read_buf) { |
1997 | tomoyo_free(head); | 1997 | kfree(head); |
1998 | return -ENOMEM; | 1998 | return -ENOMEM; |
1999 | } | 1999 | } |
2000 | } | 2000 | } |
@@ -2006,10 +2006,10 @@ static int tomoyo_open_control(const u8 type, struct file *file) | |||
2006 | head->write = NULL; | 2006 | head->write = NULL; |
2007 | } else if (head->write) { | 2007 | } else if (head->write) { |
2008 | head->writebuf_size = 4096 * 2; | 2008 | head->writebuf_size = 4096 * 2; |
2009 | head->write_buf = tomoyo_alloc(head->writebuf_size); | 2009 | head->write_buf = kzalloc(head->writebuf_size, GFP_KERNEL); |
2010 | if (!head->write_buf) { | 2010 | if (!head->write_buf) { |
2011 | tomoyo_free(head->read_buf); | 2011 | kfree(head->read_buf); |
2012 | tomoyo_free(head); | 2012 | kfree(head); |
2013 | return -ENOMEM; | 2013 | return -ENOMEM; |
2014 | } | 2014 | } |
2015 | } | 2015 | } |
@@ -2141,11 +2141,11 @@ static int tomoyo_close_control(struct file *file) | |||
2141 | 2141 | ||
2142 | tomoyo_read_unlock(head->reader_idx); | 2142 | tomoyo_read_unlock(head->reader_idx); |
2143 | /* Release memory used for policy I/O. */ | 2143 | /* Release memory used for policy I/O. */ |
2144 | tomoyo_free(head->read_buf); | 2144 | kfree(head->read_buf); |
2145 | head->read_buf = NULL; | 2145 | head->read_buf = NULL; |
2146 | tomoyo_free(head->write_buf); | 2146 | kfree(head->write_buf); |
2147 | head->write_buf = NULL; | 2147 | head->write_buf = NULL; |
2148 | tomoyo_free(head); | 2148 | kfree(head); |
2149 | head = NULL; | 2149 | head = NULL; |
2150 | file->private_data = NULL; | 2150 | file->private_data = NULL; |
2151 | return 0; | 2151 | return 0; |