Skip to content

Commit

Permalink
mtd: nand: fixup bounds checks for nand_{lock,unlock}()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brian Norris committed Mar 11, 2015
1 parent b9da8ba commit b1a2348
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
__func__, (unsigned long long)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 */
if (ofs + len == mtd->size)
Expand Down Expand Up @@ -1031,7 +1031,7 @@ int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
__func__, (unsigned long long)ofs, len);

if (check_offs_len(mtd, ofs, len))
ret = -EINVAL;
return -EINVAL;

nand_get_device(mtd, FL_LOCKING);

Expand Down

0 comments on commit b1a2348

Please sign in to comment.