mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 15:01:44 +00:00
mtd: nand: fixup bounds checks for nand_{lock,unlock}()
Coverity noticed that these 'ret' assignments weren't being used. Let's use them. Note that nand_lock() and nand_unlock() are still not officially used by any drivers. Coverity CIDs #1227054 and #1227037 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
b9da8bae41
commit
b1a2348a1a
1 changed files with 2 additions and 2 deletions
|
@ -968,7 +968,7 @@ int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
|
||||||
__func__, (unsigned long long)ofs, len);
|
__func__, (unsigned long long)ofs, len);
|
||||||
|
|
||||||
if (check_offs_len(mtd, ofs, len))
|
if (check_offs_len(mtd, ofs, len))
|
||||||
ret = -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Align to last block address if size addresses end of the device */
|
/* Align to last block address if size addresses end of the device */
|
||||||
if (ofs + len == mtd->size)
|
if (ofs + len == mtd->size)
|
||||||
|
@ -1031,7 +1031,7 @@ int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
|
||||||
__func__, (unsigned long long)ofs, len);
|
__func__, (unsigned long long)ofs, len);
|
||||||
|
|
||||||
if (check_offs_len(mtd, ofs, len))
|
if (check_offs_len(mtd, ofs, len))
|
||||||
ret = -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
nand_get_device(mtd, FL_LOCKING);
|
nand_get_device(mtd, FL_LOCKING);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue