diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-12-10 18:41:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:02 -0500 |
commit | 4b99d39b1b2890a178d840f7a068305c7890faee (patch) | |
tree | 3de728c6a7e4d025372e568cd1b27b56f8b4b727 /fs/cifs | |
parent | bc09d141ebb26c0c1ab713c8597ca833be9afee4 (diff) |
fs/cifs/file.c: replace count*size kzalloc by kcalloc
kcalloc manages count*sizeof overflow.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Steve French <sfrench@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 3e4d00a06c44..b123a64d7be4 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1066,7 +1066,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) | |||
1066 | 1066 | ||
1067 | max_num = (max_buf - sizeof(struct smb_hdr)) / | 1067 | max_num = (max_buf - sizeof(struct smb_hdr)) / |
1068 | sizeof(LOCKING_ANDX_RANGE); | 1068 | sizeof(LOCKING_ANDX_RANGE); |
1069 | buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); | 1069 | buf = kcalloc(max_num, sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); |
1070 | if (!buf) { | 1070 | if (!buf) { |
1071 | free_xid(xid); | 1071 | free_xid(xid); |
1072 | return -ENOMEM; | 1072 | return -ENOMEM; |
@@ -1401,7 +1401,7 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, | |||
1401 | 1401 | ||
1402 | max_num = (max_buf - sizeof(struct smb_hdr)) / | 1402 | max_num = (max_buf - sizeof(struct smb_hdr)) / |
1403 | sizeof(LOCKING_ANDX_RANGE); | 1403 | sizeof(LOCKING_ANDX_RANGE); |
1404 | buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); | 1404 | buf = kcalloc(max_num, sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); |
1405 | if (!buf) | 1405 | if (!buf) |
1406 | return -ENOMEM; | 1406 | return -ENOMEM; |
1407 | 1407 | ||