Skip to contentSkip to conversation

mtd: Change positive error return into negative in mtd_do_writeoob()

PATCH Applied Roel Kluin 2 participants 2 messages Jan 29, 2010 – Feb 8, 2010 Memory technology devices (MTD)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 mtd: Change positive error return into negative in mtd_do_writeoob()

The error return should be negative

---
 drivers/mtd/mtdchar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/mtdchar.c +1 -1
index 5b081cb..01d5837 100644
@@ -373,7 +373,7 @@ static int mtd_do_writeoob(struct file *file, struct mtd_info *mtd,
 	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;
#1 lore raw
Quoted 6 lines · Roel Kluin

The error return should be negative

---
 drivers/mtd/mtdchar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Pushed to l2-mtd-2.6.git/master

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)