[patch 5/5] mtd: change positive error return into negative in mtd_do_writeoob()

akpm at linux-foundation.org akpm at linux-foundation.org
Tue Feb 2 17:43:12 EST 2010


From: Roel Kluin <roel.kluin at gmail.com>

The error return should be negative

Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
Cc: David Woodhouse <dwmw2 at infradead.org>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
---

 drivers/mtd/mtdchar.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/mtd/mtdchar.c~mtd-change-positive-error-return-into-negative-in-mtd_do_writeoob drivers/mtd/mtdchar.c
--- a/drivers/mtd/mtdchar.c~mtd-change-positive-error-return-into-negative-in-mtd_do_writeoob
+++ a/drivers/mtd/mtdchar.c
@@ -373,7 +373,7 @@ static int mtd_do_writeoob(struct file *
 	if (!mtd->write_oob)
 		ret = -EOPNOTSUPP;
 	else
-		ret = access_ok(VERIFY_READ, ptr, length) ? 0 : EFAULT;
+		ret = access_ok(VERIFY_READ, ptr, length) ? 0 : -EFAULT;
 
 	if (ret)
 		return ret;
_



More information about the linux-mtd mailing list