From: "Figo.zhang" <figo1802@gmail.com>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Ian Abbott <abbotti@mev.co.uk>,
Frank Mori Hess <fmhess@users.sourceforge.net>,
David Schleef <ds@schleef.org>,
lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH V2] no need for checking it
Date: Sat, 06 Jun 2009 19:11:31 +0800 [thread overview]
Message-ID: <1244286691.3185.42.camel@myhost> (raw)
In-Reply-To: <1244285472.3185.36.camel@myhost>
vfree() does it's own NULL checking,so no need for check before
calling it.
'pages' is local variable argment,so in v2, it is no need assignment
to NULL.
Signed-off-by: Figo.zhang <figo1802@gmail.com>
---
drivers/staging/comedi/drivers.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 6e13e45..587283a 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -495,9 +495,8 @@ int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
vmap(pages, n_pages, VM_MAP,
PAGE_KERNEL_NOCACHE);
}
- if (pages) {
- vfree(pages);
- }
+ vfree(pages);
+
if (async->prealloc_buf == NULL) {
/* Some allocation failed above. */
if (async->buf_page_list) {
next prev parent reply other threads:[~2009-06-06 11:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-06 10:51 [PATCH] no need for checking it Figo.zhang
2009-06-06 10:56 ` Pekka Enberg
2009-06-06 11:08 ` Figo.zhang
2009-06-06 11:11 ` Figo.zhang [this message]
2009-06-06 11:29 ` [PATCH V2] " Pekka Enberg
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=1244286691.3185.42.camel@myhost \
--to=figo1802@gmail.com \
--cc=abbotti@mev.co.uk \
--cc=ds@schleef.org \
--cc=fmhess@users.sourceforge.net \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.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