mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 04:53:36 +01:00
Use kvzalloc to make your code better
Use kvzalloc to make your code better
This commit is contained in:
parent
d96d875ef5
commit
af9af4a84f
1 changed files with 1 additions and 2 deletions
|
@ -1173,11 +1173,10 @@ struct xt_table_info *xt_alloc_table_info(unsigned int size)
|
|||
if (sz < sizeof(*info) || sz >= XT_MAX_TABLE_SIZE)
|
||||
return NULL;
|
||||
|
||||
info = kvmalloc(sz, GFP_KERNEL_ACCOUNT);
|
||||
info = kvzalloc(sz, GFP_KERNEL_ACCOUNT);
|
||||
if (!info)
|
||||
return NULL;
|
||||
|
||||
memset(info, 0, sizeof(*info));
|
||||
info->size = size;
|
||||
return info;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue