Patchwork Fix docg3 read align bug

login
register
mail settings
Submitter Robert Jarzmik
Date March 25, 2012, 9:47 p.m.
Message ID <87haxcs68e.fsf@free.fr>
Download mbox | patch
Permalink /patch/148588/
State New
Headers show

Comments

Robert Jarzmik - March 25, 2012, 9:47 p.m.
Hi Artem,

I sent not long ago a patch for unaligned reads. And ... I made an error. I have
a patch to patch my previous submission. I wonder if this can be squashed in, or
requires an incremental commit. Tell me what you want to do, the patch is at the
end of the mail.

I hope I have not overseen another corner case, I'll recheck tomorrow evening
(GMT+1).

Cheers.
Artem Bityutskiy - March 26, 2012, 9:51 a.m.
On Sun, 2012-03-25 at 23:47 +0200, Robert Jarzmik wrote:
> Hi Artem,
> 
> I sent not long ago a patch for unaligned reads. And ... I made an error. I have
> a patch to patch my previous submission. I wonder if this can be squashed in, or
> requires an incremental commit. Tell me what you want to do, the patch is at the
> end of the mail.
> 
> I hope I have not overseen another corner case, I'll recheck tomorrow evening
> (GMT+1).

Shoved in, thanks!

Patch

diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 7ced089..8272c02 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -893,7 +893,8 @@  static int doc_read_oob(struct mtd_info *mtd, loff_t from,
 		ret = doc_read_page_getbytes(docg3, nbdata, buf, 0);
 		if (ret < nbdata)
 			goto err_in_read;
-		doc_read_page_getbytes(docg3, DOC_LAYOUT_PAGE_SIZE - nbdata,
+		doc_read_page_getbytes(docg3,
+				       DOC_LAYOUT_PAGE_SIZE - nbdata - skip,
 				       NULL, 0);
 		ret = doc_read_page_getbytes(docg3, nboob, oobbuf, 0);
 		if (ret < nboob)