mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-19 04:14:49 +08:00
s390: Convert vmalloc/memset to vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
81d66c70b5
commit
dc8a5c9935
@ -562,10 +562,9 @@ static int dbfs_d204_create(void **data, void **data_free_ptr, size_t *size)
|
||||
void *base;
|
||||
|
||||
buf_size = PAGE_SIZE * (diag204_buf_pages + 1) + sizeof(d204->hdr);
|
||||
base = vmalloc(buf_size);
|
||||
base = vzalloc(buf_size);
|
||||
if (!base)
|
||||
return -ENOMEM;
|
||||
memset(base, 0, buf_size);
|
||||
d204 = page_align_ptr(base + sizeof(d204->hdr)) - sizeof(d204->hdr);
|
||||
rc = diag204_do_store(d204->buf, diag204_buf_pages);
|
||||
if (rc) {
|
||||
|
@ -335,10 +335,9 @@ cio_ignore_write(struct file *file, const char __user *user_buf,
|
||||
return -EINVAL;
|
||||
if (user_len > 65536)
|
||||
user_len = 65536;
|
||||
buf = vmalloc (user_len + 1); /* maybe better use the stack? */
|
||||
buf = vzalloc(user_len + 1); /* maybe better use the stack? */
|
||||
if (buf == NULL)
|
||||
return -ENOMEM;
|
||||
memset(buf, 0, user_len + 1);
|
||||
|
||||
if (strncpy_from_user (buf, user_buf, user_len) < 0) {
|
||||
rc = -EFAULT;
|
||||
|
Loading…
Reference in New Issue
Block a user