mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
To: Kulikov Vasiliy <segooon@gmail.com>
Cc: kernel-janitors@vger.kernel.org, Steve French <sfrench@samba.org>,
	Jeff Layton <jlayton@redhat.com>, 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: Fri, 16 Jul 2010 11:35:30 -0500	[thread overview]
Message-ID: <1279298130.26876.12.camel@shaggy-w500> (raw)
In-Reply-To: <1279296925-25147-1-git-send-email-segooon@gmail.com>

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


  reply	other threads:[~2010-07-16 16:35 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 [this message]
2010-07-19 18:50   ` Jeff Layton
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=1279298130.26876.12.camel@shaggy-w500 \
    --to=shaggy@linux.vnet.ibm.com \
    --cc=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=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®