storage: flash_map: Fix checking unsigned for negative value
The unsigned size_t type variables have been checked for having negative values. Fixes #28171, Coverity-CID: 214224 Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
parent
5f0991d84b
commit
4e76da8ab1
1 changed files with 2 additions and 2 deletions
|
@ -281,8 +281,8 @@ int flash_area_check_int_sha256(const struct flash_area *fa,
|
|||
int pos;
|
||||
int rc;
|
||||
|
||||
if (!fa || !fac || !fac->match || !fac->rbuf ||
|
||||
fac->clen <= 0 || fac->off < 0 || fac->rblen <= 0) {
|
||||
if (fa == NULL || fac == NULL || fac->match == NULL ||
|
||||
fac->rbuf == NULL || fac->clen == 0 || fac->rblen == 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue