提交 f55fdcca 编写于 作者: K Kulikov Vasiliy 提交者: Steve French

fs: cifs: check kmalloc() result

If kmalloc() fails exit with -ENOMEM.
Signed-off-by: NKulikov Vasiliy <segooon@gmail.com>
Acked-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
Acked-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 0ccd4802
......@@ -847,6 +847,11 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + max_len;
tmp_buf = kmalloc(UNICODE_NAME_MAX, GFP_KERNEL);
if (tmp_buf == NULL) {
rc = -ENOMEM;
break;
}
for (i = 0; (i < num_to_fill) && (rc == 0); i++) {
if (current_entry == NULL) {
/* evaluate whether this case is an error */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册