aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFigo.zhang <figo1802@gmail.com>2009-06-06 19:11:31 +0800
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:01:33 -0700
commitb455073c885cf78cfea1704ce9587806ec8e3c30 (patch)
treeecce71c4119e24a960204fa4673bf7521758520e /drivers
parent0a85b6f0ab0d2edb0d41b32697111ce0e4f43496 (diff)
Staging: comedi: no need for checking vfree call
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> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/comedi/drivers.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 5157c89ec4e..dc53aeeac68 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -509,9 +509,8 @@ int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
async->prealloc_buf =
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) {