mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
cmd: ubi: remove unnecessary logical constraint
A size_t variable can never be negative. The problem was indicated by cppcheck. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
f6c1df44b8
commit
18f41f2fa2
1 changed files with 1 additions and 1 deletions
|
@ -308,7 +308,7 @@ int ubi_volume_begin_write(char *volume, void *buf, size_t size,
|
|||
return ENODEV;
|
||||
|
||||
rsvd_bytes = vol->reserved_pebs * (ubi->leb_size - vol->data_pad);
|
||||
if (size < 0 || size > rsvd_bytes) {
|
||||
if (size > rsvd_bytes) {
|
||||
printf("size > volume size! Aborting!\n");
|
||||
return EINVAL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue