diff options
author | Rajat Verma <rajat.verma@stericsson.com> | 2011-11-03 14:53:28 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:07:03 +0200 |
commit | 28aca83fac60b63d03c33428ea5cf02e0ae73523 (patch) | |
tree | a2c605f13526241ef728742c1256c8c958ade706 | |
parent | 872dcea1624d339d205e1e8a31e8f29be8d84ccb (diff) |
staging: mmio: Corrects bug in buffer copy
In copy_user_buffer(), result of "kmalloc()" called is
checked against NULL as "if (!dest_buf)" whereas correct
check must be "if (!*dest_buf)" as memory allocation is
done against *dest_buf and not dest_buf.
ST-Ericsson ID: 369361
ST-Ericsson FOSS-OUT ID: Trivial
ST-Ericsson Linux next: NA
Change-Id: I78971455a8aa3cb3b31a27572939f2e64fc4d65e
Signed-off-by: Rajat Verma <rajat.verma@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/36170
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r-- | drivers/staging/mmio/st_mmio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/mmio/st_mmio.c b/drivers/staging/mmio/st_mmio.c index 51e92666e28..a006c55c544 100644 --- a/drivers/staging/mmio/st_mmio.c +++ b/drivers/staging/mmio/st_mmio.c @@ -245,7 +245,7 @@ static int copy_user_buffer(void __iomem **dest_buf, *dest_buf = kmalloc(size, GFP_KERNEL); - if (!dest_buf) { + if (!*dest_buf) { err = -ENOMEM; goto nomem; } |