Understanding OOB data read implementation (II)

Artem Bityutskiy dedekind1 at gmail.com
Sat Oct 16 15:37:22 EDT 2010


On Fri, 2010-10-15 at 12:29 +0100, David Peverley wrote:
> Hi again...!
> 
> I've also noticed after blindly copying it that in the DoC drivers
> that the OOB reads use the ops->len for size :
>     static int doc_read_oob(struct mtd_info *mtd, loff_t ofs,
>                             struct mtd_oob_ops *ops)
>         ...
>         uint8_t *buf = ops->oobbuf;
>         size_t len = ops->len;
>         ...
> 
> Reading mtd.h and the following patch summary :
>     http://www.mail-archive.com/git-commits-head@vger.kernel.org/msg03799.html
> 
> I suspect this is wrong and should be using ops->ooblen instead. This
> is especially true given that mtdchar.c leaves ops->len
> uninitialised....! (should mtdchar.c:mtd_do_readoob() not zero the ops
> structure as it's a local automatic so not zero-initialised?) Again
> this is copied in doc2001.c and doc2001plus.c.

If you can test the change - please send a patch.

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list