From: Fabian Frederick Date: Wed, 10 Dec 2014 23:41:17 +0000 (-0800) Subject: fs/cifs/file.c: replace count*size kzalloc by kcalloc X-Git-Tag: v4.9.8~5219^2~187 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b99d39b1b2890a178d840f7a068305c7890faee;p=platform%2Fkernel%2Flinux-rpi3.git fs/cifs/file.c: replace count*size kzalloc by kcalloc kcalloc manages count*sizeof overflow. Signed-off-by: Fabian Frederick Cc: Steve French Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 3e4d00a..b123a64 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1066,7 +1066,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) max_num = (max_buf - sizeof(struct smb_hdr)) / sizeof(LOCKING_ANDX_RANGE); - buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); + buf = kcalloc(max_num, sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); if (!buf) { free_xid(xid); return -ENOMEM; @@ -1401,7 +1401,7 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, max_num = (max_buf - sizeof(struct smb_hdr)) / sizeof(LOCKING_ANDX_RANGE); - buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); + buf = kcalloc(max_num, sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); if (!buf) return -ENOMEM;