mtd: nand: fixup bounds checks for nand_{lock,unlock}()
authorBrian Norris <computersforpeace@gmail.com>
Sat, 28 Feb 2015 10:02:27 +0000 (02:02 -0800)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 11 Mar 2015 22:21:48 +0000 (15:21 -0700)
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>
drivers/mtd/nand/nand_base.c

index df7eb4ff07d156ec213b3656f9840f6e99a35710..5488a7ad63e703e49f2361ce5f01fc37f3251caa 100644 (file)
@@ -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)
@@ -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);