提交 117e3b7f 编写于 作者: S Steve French 提交者: Steve French

CIFS: set *resp_buf_type to NO_BUFFER on error

Dan Carpenter had pointed this out a while ago, but the code around
this had changed so wasn't causing any problems since that field
was not used in this error path.

Still, it is cleaner to always initialize this field, so changing
the error path to set it.
Reviewed-by: NRonnie Sahlberg <lsahlber@redhat.com>
CC: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NSteve French <smfrench@gmail.com>
上级 6d08b06e
...@@ -834,8 +834,11 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses, ...@@ -834,8 +834,11 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
if (n_vec + 1 > CIFS_MAX_IOV_SIZE) { if (n_vec + 1 > CIFS_MAX_IOV_SIZE) {
new_iov = kmalloc(sizeof(struct kvec) * (n_vec + 1), new_iov = kmalloc(sizeof(struct kvec) * (n_vec + 1),
GFP_KERNEL); GFP_KERNEL);
if (!new_iov) if (!new_iov) {
/* otherwise cifs_send_recv below sets resp_buf_type */
*resp_buf_type = CIFS_NO_BUFFER;
return -ENOMEM; return -ENOMEM;
}
} else } else
new_iov = s_iov; new_iov = s_iov;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册