Skip to content

Commit

Permalink
Staging: comedi: no need for checking vfree call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Figo.zhang authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent 0a85b6f commit b455073
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b455073

Please sign in to comment.