projects
/
platform
/
kernel
/
linux-amlogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
71b9f47
)
MTD: Coverity defect cleanup: MTD [1/1]
author
xianjun.liu
<xianjun.liu@amlogic.com>
Mon, 16 Sep 2019 07:56:11 +0000
(15:56 +0800)
committer
Tao Zeng
<tao.zeng@amlogic.com>
Mon, 16 Sep 2019 10:23:52 +0000
(
03:23
-0700)
PD#SWPL-13991
Problem:
Out-of-bounds read in get_free_node
Solution:
fix the issue
Verify:
AXG400
Change-Id: I6e41caf3b3118d524218d6023fb51df692865cba
Signed-off-by: xianjun.liu <xianjun.liu@amlogic.com>
drivers/amlogic/mtd/rsv_manage.c
patch
|
blob
|
history
diff --git
a/drivers/amlogic/mtd/rsv_manage.c
b/drivers/amlogic/mtd/rsv_manage.c
index
7b6d2d8
..
d49a7ce
100644
(file)
--- a/
drivers/amlogic/mtd/rsv_manage.c
+++ b/
drivers/amlogic/mtd/rsv_manage.c
@@
-44,7
+44,7
@@
static struct free_node_t *get_free_node(struct mtd_info *mtd)
index = find_first_zero_bit((void *)&aml_chip->freeNodeBitmask,
RESERVED_BLOCK_NUM);
- if (index > RESERVED_BLOCK_NUM) {
+ if (index >
=
RESERVED_BLOCK_NUM) {
pr_info("%s %d: index is greater than max! error",
__func__, __LINE__);
return NULL;