fs: cifs: check kmalloc() result
Subsystems (3)
PATCH 10/15 fs: cifs: check kmalloc() result
If kmalloc() fails exit with -ENOMEM.
Signed-off-by Kulikov Vasiliy <[email protected]>
--- fs/cifs/readdir.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
fs/cifs/readdir.c +5 -0
@@ -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 */
Signature · 1 line
1.7.0.4
Quoted 1 line · Kulikov Vasiliy
If
kmalloc()fails exit with-ENOMEM.
Looks good to me. Add my ack if you want it.
Quoted 1 line
Signed-off-by Kulikov Vasiliy <[email protected]>
Acked-by Dave Kleikamp <[email protected]>
Quoted 20 lines
--- fs/cifs/readdir.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)fs/cifs/readdir.c +5
-0@@ -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 */
Signature · 2 lines
Dave Kleikamp IBM Linux Technology Center
Jeff Layton
Acked-byQuoted 20 lines · On Fri, 16 Jul 2010 11:35:30 -0500 Dave Kleikamp <[email protected]>…
Quoted 1 line · Kulikov Vasiliy
If
kmalloc()fails exit with-ENOMEM.Looks good to me. Add my ack if you want it.
Quoted 1 line
Signed-off-by Kulikov Vasiliy <[email protected]>Acked-by Dave Kleikamp <[email protected]>Quoted 11 lines
--- fs/cifs/readdir.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)fs/cifs/readdir.c +0
-0@@ -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;
Quoted 10 lines
fs/cifs/readdir.c int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) · line 857
Quoted 9 lines
fs/cifs/readdir.c +5
-0tmp_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 */
Looks good to me too.
Acked-by Jeff Layton <[email protected]>
Steve French
Appliedmerged into cifs-2.6.git
Quoted 27 lines · Kulikov Vasiliy
If
kmalloc()fails exit with-ENOMEM.Signed-off-by Kulikov Vasiliy <[email protected]>---
fs/cifs/readdir.c | 5 +++++1 files changed, 5 insertions(+), 0 deletions(-)fs/cifs/readdir.c +5
-1@@ -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 */ --1.7.0.4
Signature · 7 lines
Thanks, Steve -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html