Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966916Ab0GSV6Y (ORCPT ); Mon, 19 Jul 2010 17:58:24 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:43598 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965308Ab0GSV6W convert rfc822-to-8bit (ORCPT ); Mon, 19 Jul 2010 17:58:22 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Ba91t/M6tTFkdVsIkNrUcSnYRAHnbw88phu0xgUMSXIJ3oGELNVOC1YOnOv/01YviD 9dFwu6C4dgeV4+yI7z1TRnuv+PEiegqsEYilxwdJPoYOJmTyx0DNl0WptHBn4A4BwB+h BElmDYfyQW3gGYLbXt1e7YfJDfN8rP7eh6zh4= MIME-Version: 1.0 In-Reply-To: <1279296925-25147-1-git-send-email-segooon@gmail.com> References: <1279296925-25147-1-git-send-email-segooon@gmail.com> Date: Mon, 19 Jul 2010 16:58:21 -0500 Message-ID: Subject: Re: [PATCH 10/15] fs: cifs: check kmalloc() result From: Steve French To: Kulikov Vasiliy Cc: kernel-janitors@vger.kernel.org, Steve French , Jeff Layton , Dave Kleikamp , Tejun Heo , Joe Perches , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1291 Lines: 42 merged into cifs-2.6.git On Fri, Jul 16, 2010 at 11:15 AM, Kulikov Vasiliy wrote: > If kmalloc() fails exit with -ENOMEM. > > Signed-off-by: Kulikov Vasiliy > --- > ?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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/