[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061219084357.GG4049@APFDCB5C>
Date: Tue, 19 Dec 2006 17:43:57 +0900
From: Akinobu Mita <akinobu.mita@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Hoang-Nam Nguyen <hnguyen@...ibm.com>,
Christoph Raisch <raisch@...ibm.com>
Subject: [PATCH] ehca: fix do_mmap() error check
The return value of do_mmap() should be checked by IS_ERR().
Cc: Hoang-Nam Nguyen <hnguyen@...ibm.com>
Cc: Christoph Raisch <raisch@...ibm.com>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
---
drivers/infiniband/hw/ehca/ehca_uverbs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: 2.6-mm/drivers/infiniband/hw/ehca/ehca_uverbs.c
===================================================================
--- 2.6-mm.orig/drivers/infiniband/hw/ehca/ehca_uverbs.c
+++ 2.6-mm/drivers/infiniband/hw/ehca/ehca_uverbs.c
@@ -321,14 +321,14 @@ int ehca_mmap_nopage(u64 foffset, u64 le
struct vm_area_struct **vma)
{
down_write(¤t->mm->mmap_sem);
- *mapped = (void*)do_mmap(NULL,0, length, PROT_WRITE,
+ *mapped = (void*)do_mmap(NULL, 0, length, PROT_WRITE,
MAP_SHARED | MAP_ANONYMOUS,
foffset);
up_write(¤t->mm->mmap_sem);
- if (!(*mapped)) {
+ if (IS_ERR(*mapped)) {
ehca_gen_err("couldn't mmap foffset=%lx length=%lx",
foffset, length);
- return -EINVAL;
+ return PTR_ERR(*mmaped);
}
*vma = find_vma(current->mm, (u64)*mapped);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists