mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 10/15] fs: cifs: check kmalloc() result
@ 2010-07-16 16:15 Kulikov Vasiliy
  2010-07-16 16:35 ` Dave Kleikamp
  2010-07-19 21:58 ` Steve French
  0 siblings, 2 replies; 4+ messages in thread
From: Kulikov Vasiliy @ 2010-07-16 16:15 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Steve French, Jeff Layton, Dave Kleikamp, Tejun Heo, Joe Perches,
	linux-cifs, samba-technical, linux-kernel

If kmalloc() fails exit with -ENOMEM.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
 fs/cifs/readdir.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index daf1753..d5e591f 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 10/15] fs: cifs: check kmalloc() result
  2010-07-16 16:15 [PATCH 10/15] fs: cifs: check kmalloc() result Kulikov Vasiliy
@ 2010-07-16 16:35 ` Dave Kleikamp
  2010-07-19 18:50   ` Jeff Layton
  2010-07-19 21:58 ` Steve French
  1 sibling, 1 reply; 4+ messages in thread
From: Dave Kleikamp @ 2010-07-16 16:35 UTC (permalink / raw)
  To: Kulikov Vasiliy
  Cc: kernel-janitors, Steve French, Jeff Layton, Tejun Heo,
	Joe Perches, linux-cifs, samba-technical, linux-kernel

On Fri, 2010-07-16 at 20:15 +0400, Kulikov Vasiliy wrote:
> If kmalloc() fails exit with -ENOMEM.

Looks good to me.  Add my ack if you want it.

> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>

Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>

> ---
>  fs/cifs/readdir.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
> index daf1753..d5e591f 100644
> --- a/fs/cifs/readdir.c
> +++ b/fs/cifs/readdir.c
> @@ -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 */

-- 
Dave Kleikamp
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 10/15] fs: cifs: check kmalloc() result
  2010-07-16 16:35 ` Dave Kleikamp
@ 2010-07-19 18:50   ` Jeff Layton
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2010-07-19 18:50 UTC (permalink / raw)
  To: Dave Kleikamp
  Cc: Kulikov Vasiliy, kernel-janitors, Steve French, Tejun Heo,
	Joe Perches, linux-cifs, samba-technical, linux-kernel

On Fri, 16 Jul 2010 11:35:30 -0500
Dave Kleikamp <shaggy@linux.vnet.ibm.com> wrote:

> On Fri, 2010-07-16 at 20:15 +0400, Kulikov Vasiliy wrote:
> > If kmalloc() fails exit with -ENOMEM.
> 
> Looks good to me.  Add my ack if you want it.
> 
> > Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> 
> Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
> 
> > ---
> >  fs/cifs/readdir.c |    5 +++++
> >  1 files changed, 5 insertions(+), 0 deletions(-)
> > 
> > diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
> > index daf1753..d5e591f 100644
> > --- a/fs/cifs/readdir.c
> > +++ b/fs/cifs/readdir.c
> > @@ -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 */
> 

Looks good to me too.

Acked-by: Jeff Layton <jlayton@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 10/15] fs: cifs: check kmalloc() result
  2010-07-16 16:15 [PATCH 10/15] fs: cifs: check kmalloc() result Kulikov Vasiliy
  2010-07-16 16:35 ` Dave Kleikamp
@ 2010-07-19 21:58 ` Steve French
  1 sibling, 0 replies; 4+ messages in thread
From: Steve French @ 2010-07-19 21:58 UTC (permalink / raw)
  To: Kulikov Vasiliy
  Cc: kernel-janitors, Steve French, Jeff Layton, Dave Kleikamp,
	Tejun Heo, Joe Perches, linux-cifs, samba-technical,
	linux-kernel

merged into cifs-2.6.git

On Fri, Jul 16, 2010 at 11:15 AM, Kulikov Vasiliy <segooon@gmail.com> wrote:
> If kmalloc() fails exit with -ENOMEM.
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
>  fs/cifs/readdir.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
> index daf1753..d5e591f 100644
> --- a/fs/cifs/readdir.c
> +++ b/fs/cifs/readdir.c
> @@ -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
>
>



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-19 21:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-16 16:15 [PATCH 10/15] fs: cifs: check kmalloc() result Kulikov Vasiliy
2010-07-16 16:35 ` Dave Kleikamp
2010-07-19 18:50   ` Jeff Layton
2010-07-19 21:58 ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®