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

login
register
mail settings
Submitter roel kluin
Date Jan. 29, 2010, 9:35 a.m.
Message ID <4B62ABC8.7080607@gmail.com>
Download mbox | patch
Permalink /patch/43906/
State Accepted
Commit 0040476b0efa99ad0d4ffb81d8e882095420d288
Headers show

Comments

roel kluin - Jan. 29, 2010, 9:35 a.m.
The error return should be negative

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 drivers/mtd/mtdchar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Artem Bityutskiy - Feb. 8, 2010, 3:11 p.m.
On Fri, 2010-01-29 at 10:35 +0100, Roel Kluin wrote:
> The error return should be negative
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
>  drivers/mtd/mtdchar.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Pushed to l2-mtd-2.6.git/master

Patch

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 5b081cb..01d5837 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -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;