mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
MTD: Coverity defect cleanup: MTD [1/1]
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user