projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a5e0678
)
mfd: Fix off-by-one value range checking for tps65912_i2c_write
author
Axel Lin
<axel.lin@gmail.com>
Fri, 24 Jun 2011 07:34:16 +0000
(15:34 +0800)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Sun, 31 Jul 2011 21:28:25 +0000
(23:28 +0200)
If bytes == (TPS6591X_MAX_REGISTER + 1), we have a buffer overflow when
doing memcpy(&msg[1], src, bytes).
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/tps65912-i2c.c
patch
|
blob
|
history
diff --git
a/drivers/mfd/tps65912-i2c.c
b/drivers/mfd/tps65912-i2c.c
index 9ed123aa662416f30286134812df99e41f6d4917..c041f2c3d2bdd01190fd7bbc72d17acb6228c51f 100644
(file)
--- a/
drivers/mfd/tps65912-i2c.c
+++ b/
drivers/mfd/tps65912-i2c.c
@@
-57,7
+57,7
@@
static int tps65912_i2c_write(struct tps65912 *tps65912, u8 reg,
u8 msg[TPS6591X_MAX_REGISTER + 1];
int ret;
- if (bytes >
(TPS6591X_MAX_REGISTER + 1)
)
+ if (bytes >
TPS6591X_MAX_REGISTER
)
return -EINVAL;
msg[0] = reg;