From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: linux-kernel@vger.kernel.org, sfrench@us.ibm.com
Subject: Re: + cifs-check-for-granted-memory.patch added to -mm tree
Date: Sat, 18 Aug 2007 07:42:46 +0400 [thread overview]
Message-ID: <20070818034246.GA7225@cvg> (raw)
In-Reply-To: <9a8748490708171517m4c6f1330jf7990b68cebe4768@mail.gmail.com>
[Jesper Juhl - Sat, Aug 18, 2007 at 12:17:33AM +0200]
| On 17/08/07, akpm@linux-foundation.org <akpm@linux-foundation.org> wrote:
| >
| > The patch titled
| > CIFS: check for granted memory
| > has been added to the -mm tree. Its filename is
| > cifs-check-for-granted-memory.patch
| >
| > *** Remember to use Documentation/SubmitChecklist when testing your code ***
| >
| > See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
| > out what to do about this
| >
| > ------------------------------------------------------
| > Subject: CIFS: check for granted memory
| > From: Cyrill Gorcunov <gorcunov@gmail.com>
| >
| > Add a check for granted memory to prevent possible NULL pointer usage.
| >
| > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| > Cc: Steven French <sfrench@us.ibm.com>
| > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| > ---
| >
| > fs/cifs/sess.c | 4 ++++
| > 1 files changed, 4 insertions(+)
| >
| > diff -puN fs/cifs/sess.c~cifs-check-for-granted-memory fs/cifs/sess.c
| > --- a/fs/cifs/sess.c~cifs-check-for-granted-memory
| > +++ a/fs/cifs/sess.c
| > @@ -372,6 +372,10 @@ CIFS_SessSetup(unsigned int xid, struct
| >
| > /* 2000 big enough to fit max user, domain, NOS name etc. */
| > str_area = kmalloc(2000, GFP_KERNEL);
| > + if (str_area == NULL) {
| > + cifs_small_buf_release(smb_buf);
| > + return -ENOMEM;
| > + }
|
| The patch, as such, is fine - not arguing against it, but as a matter
| of style; don't we usually prefer the "if (!foo)" form over "if (foo
| == NULL)" ??
I just don't wanna mess 'if (!ptr)' and 'if (ptr == NULL)'
in the procedure. Look at the code ;) Some procs in CIFS
_does_ use '!ptr' but others - 'ptr == NULL'. So in the
proc being patched 'if (ptr == NULL)' is assumed.
|
| --
| Jesper Juhl <jesper.juhl@gmail.com>
| Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
| Plain text mails only, please http://www.expita.com/nomime.html
|
Cyrill
prev parent reply other threads:[~2007-08-18 3:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-17 21:50 + cifs-check-for-granted-memory.patch added to -mm tree akpm
2007-08-17 22:17 ` Jesper Juhl
2007-08-18 3:42 ` Cyrill Gorcunov [this message]
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=20070818034246.GA7225@cvg \
--to=gorcunov@gmail.com \
--cc=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sfrench@us.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.