mtd: nand: fixup bounds checks for nand_{lock,unlock}()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Apr 22 10:59:03 PDT 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b1a2348a1ac1380adf429035dbf3fdad0d5367bc
Commit:     b1a2348a1ac1380adf429035dbf3fdad0d5367bc
Parent:     b9da8bae416efda5ad61c7c92edbb30de15ff7ee
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Sat Feb 28 02:02:27 2015 -0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Mar 11 15:21:48 2015 -0700

    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 at gmail.com>
---
 drivers/mtd/nand/nand_base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index df7eb4f..5488a7a 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -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);
 



More information about the linux-mtd-cvs mailing list