Commit b455073c authored by Figo.zhang's avatar Figo.zhang Committed by Greg Kroah-Hartman

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: default avatarFigo.zhang <figo1802@gmail.com>
Acked-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0a85b6f0
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment