mtd: concat: set the return lengths properly

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Feb 16 18:59:06 PST 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d164ea32674ec82e80f480769ffcd2144f901380
Commit:     d164ea32674ec82e80f480769ffcd2144f901380
Parent:     be802bf955a1aa9b92b71395405899ce076eca6e
Author:     Niklas Cassel <niklas.cassel at axis.com>
AuthorDate: Tue Jan 20 10:35:32 2015 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Thu Feb 5 20:32:20 2015 -0800

    mtd: concat: set the return lengths properly
    
    In concat_read_oob both retlen and oobretlen should be updated.
    concat_write_oob previously only (improperly) updated retlen.
    
    Signed-off-by: Niklas Cassel <niklass at axis.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/mtdconcat.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index b900056..d85c946 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -311,7 +311,8 @@ concat_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops)
 			devops.len = subdev->size - to;
 
 		err = mtd_write_oob(subdev, to, &devops);
-		ops->retlen += devops.oobretlen;
+		ops->retlen += devops.retlen;
+		ops->oobretlen += devops.oobretlen;
 		if (err)
 			return err;
 



More information about the linux-mtd-cvs mailing list