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

Submitted by Andrew Morton on Feb. 2, 2010, 10:43 p.m.

Details

Message ID 201002022243.o12MhCdk019188@imap1.linux-foundation.org
State New, archived
Headers show

Commit Message

Andrew Morton Feb. 2, 2010, 10:43 p.m.
From: Roel Kluin <roel.kluin@gmail.com>

The error return should be negative

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

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

Patch hide | download patch | download mbox

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;