diff options
Diffstat (limited to 'fs/smb/client/misc.c')
| -rw-r--r-- | fs/smb/client/misc.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c index 1773e3b471aa..290d0a0bea53 100644 --- a/fs/smb/client/misc.c +++ b/fs/smb/client/misc.c @@ -67,7 +67,7 @@ sesInfoAlloc(void) { struct cifs_ses *ret_buf; - ret_buf = kzalloc(sizeof(struct cifs_ses), GFP_KERNEL); + ret_buf = kzalloc_obj(struct cifs_ses, GFP_KERNEL); if (ret_buf) { atomic_inc(&sesInfoAllocCount); spin_lock_init(&ret_buf->ses_lock); @@ -118,7 +118,7 @@ tcon_info_alloc(bool dir_leases_enabled, enum smb3_tcon_ref_trace trace) struct cifs_tcon *ret_buf; static atomic_t tcon_debug_id; - ret_buf = kzalloc(sizeof(*ret_buf), GFP_KERNEL); + ret_buf = kzalloc_obj(*ret_buf, GFP_KERNEL); if (!ret_buf) return NULL; @@ -499,7 +499,8 @@ cifs_close_deferred_file(struct cifsInodeInfo *cifs_inode) cifs_del_deferred_close(cfile); spin_unlock(&cifs_inode->deferred_lock); - tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC); + tmp_list = kmalloc_obj(struct file_list, + GFP_ATOMIC); if (tmp_list == NULL) break; tmp_list->cfile = cfile; @@ -531,7 +532,8 @@ cifs_close_all_deferred_files(struct cifs_tcon *tcon) cifs_del_deferred_close(cfile); spin_unlock(&CIFS_I(d_inode(cfile->dentry))->deferred_lock); - tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC); + tmp_list = kmalloc_obj(struct file_list, + GFP_ATOMIC); if (tmp_list == NULL) break; tmp_list->cfile = cfile; @@ -564,7 +566,7 @@ void cifs_close_deferred_file_under_dentry(struct cifs_tcon *tcon, cifs_del_deferred_close(cfile); spin_unlock(&CIFS_I(d_inode(cfile->dentry))->deferred_lock); - tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC); + tmp_list = kmalloc_obj(struct file_list, GFP_ATOMIC); if (tmp_list == NULL) break; tmp_list->cfile = cfile; @@ -671,8 +673,8 @@ parse_dfs_referrals(struct get_dfs_referral_rsp *rsp, u32 rsp_size, cifs_dbg(FYI, "num_referrals: %d dfs flags: 0x%x ...\n", *num_of_nodes, le32_to_cpu(rsp->DFSFlags)); - *target_nodes = kcalloc(*num_of_nodes, sizeof(struct dfs_info3_param), - GFP_KERNEL); + *target_nodes = kzalloc_objs(struct dfs_info3_param, *num_of_nodes, + GFP_KERNEL); if (*target_nodes == NULL) { rc = -ENOMEM; goto parse_DFS_referrals_exit; |
