Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 662e9b2b authored by Fabian Frederick's avatar Fabian Frederick Committed by Linus Torvalds
Browse files

fs/cifs/smb2file.c: replace count*size kzalloc by kcalloc



kcalloc manages count*sizeof overflow.

Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Cc: Steve French <sfrench@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4b99d39b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
		return -EINVAL;

	max_num = max_buf / sizeof(struct smb2_lock_element);
	buf = kzalloc(max_num * sizeof(struct smb2_lock_element), GFP_KERNEL);
	buf = kcalloc(max_num, sizeof(struct smb2_lock_element), GFP_KERNEL);
	if (!buf)
		return -ENOMEM;

@@ -247,7 +247,7 @@ smb2_push_mandatory_locks(struct cifsFileInfo *cfile)
	}

	max_num = max_buf / sizeof(struct smb2_lock_element);
	buf = kzalloc(max_num * sizeof(struct smb2_lock_element), GFP_KERNEL);
	buf = kcalloc(max_num, sizeof(struct smb2_lock_element), GFP_KERNEL);
	if (!buf) {
		free_xid(xid);
		return -ENOMEM;