diff options
author | Linus Torvalds | 2019-05-31 22:49:50 +0200 |
---|---|---|
committer | Linus Torvalds | 2019-05-31 22:49:50 +0200 |
commit | 41e7231fab9d76e906b6d8abe09c44c7b9656d33 (patch) | |
tree | f250117954733a4827e5dd9b313c52314895da91 /fs/cifs/smb2pdu.c | |
parent | Merge branch 'next-fixes-for-5.2-rc' of git://git.kernel.org/pub/scm/linux/ke... (diff) | |
parent | CIFS: cifs_read_allocate_pages: don't iterate through whole page array on ENOMEM (diff) | |
download | kernel-qcow2-linux-41e7231fab9d76e906b6d8abe09c44c7b9656d33.tar.gz kernel-qcow2-linux-41e7231fab9d76e906b6d8abe09c44c7b9656d33.tar.xz kernel-qcow2-linux-41e7231fab9d76e906b6d8abe09c44c7b9656d33.zip |
Merge tag 'v5.2-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French:
"Four small smb3 fixes, one for stable"
* tag 'v5.2-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
CIFS: cifs_read_allocate_pages: don't iterate through whole page array on ENOMEM
dfs_cache: fix a wrong use of kfree in flush_cache_ent()
fs/cifs/smb2pdu.c: fix buffer free in SMB2_ioctl_free
cifs: fix memory leak of pneg_inbuf on -EOPNOTSUPP ioctl case
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r-- | fs/cifs/smb2pdu.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 710ceb875161..29b699d532ef 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -1054,7 +1054,8 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) * not supported error. Client should accept it. */ cifs_dbg(VFS, "Server does not support validate negotiate\n"); - return 0; + rc = 0; + goto out_free_inbuf; } else if (rc != 0) { cifs_dbg(VFS, "validate protocol negotiate failed: %d\n", rc); rc = -EIO; @@ -2619,10 +2620,12 @@ SMB2_ioctl_init(struct cifs_tcon *tcon, struct smb_rqst *rqst, void SMB2_ioctl_free(struct smb_rqst *rqst) { + int i; if (rqst && rqst->rq_iov) { cifs_small_buf_release(rqst->rq_iov[0].iov_base); /* request */ - if (rqst->rq_iov[1].iov_len) - kfree(rqst->rq_iov[1].iov_base); + for (i = 1; i < rqst->rq_nvec; i++) + if (rqst->rq_iov[i].iov_base != smb2_padding) + kfree(rqst->rq_iov[i].iov_base); } } |