mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: Kulikov Vasiliy <segooon@gmail.com>,
	kernel-janitors@vger.kernel.org, Steve French <sfrench@samba.org>,
	Tejun Heo <tj@kernel.org>, Joe Perches <joe@perches.com>,
	linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 10/15] fs: cifs: check kmalloc() result
Date: Mon, 19 Jul 2010 14:50:20 -0400	[thread overview]
Message-ID: <20100719145020.205ece82@tlielax.poochiereds.net> (raw)
In-Reply-To: <1279298130.26876.12.camel@shaggy-w500>

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>

  reply	other threads:[~2010-07-19 18:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-16 16:15 Kulikov Vasiliy
2010-07-16 16:35 ` Dave Kleikamp
2010-07-19 18:50   ` Jeff Layton [this message]
2010-07-19 21:58 ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100719145020.205ece82@tlielax.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=segooon@gmail.com \
    --cc=sfrench@samba.org \
    --cc=shaggy@linux.vnet.ibm.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®