mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 00:08:50 +00:00
fs: cifs: check kmalloc() result
If kmalloc() fails exit with -ENOMEM. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
This commit is contained in:
parent
0ccd48025f
commit
f55fdcca6b
@ -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;
|
end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + max_len;
|
||||||
|
|
||||||
tmp_buf = kmalloc(UNICODE_NAME_MAX, GFP_KERNEL);
|
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++) {
|
for (i = 0; (i < num_to_fill) && (rc == 0); i++) {
|
||||||
if (current_entry == NULL) {
|
if (current_entry == NULL) {
|
||||||
/* evaluate whether this case is an error */
|
/* evaluate whether this case is an error */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user