From: Figo.zhang Date: Sat, 6 Jun 2009 11:11:31 +0000 (+0800) Subject: Staging: comedi: no need for checking vfree call X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b455073c885cf78cfea1704ce9587806ec8e3c30;p=linux-beck.git 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 Acked-by: Pekka Enberg Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index 5157c89ec4ee..dc53aeeac68f 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) {