[PATCH] mtdoops: fix the oops_page_used array size

Artem Bityutskiy dedekind1 at gmail.com
Sun Dec 4 08:44:57 EST 2011


On Tue, 2011-11-29 at 12:49 +0200, Roman Tereshonkov wrote:
> The array of unsigned long pointed by oops_page_used is allocated
> by vmalloc which requires the size to be in bytes.
> 
> Signed-off-by: Roman Tereshonkov <roman.tereshonkov at nokia.com>
> ---
>  drivers/mtd/mtdoops.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
> index 1e2fa62..0782b31 100644
> --- a/drivers/mtd/mtdoops.c
> +++ b/drivers/mtd/mtdoops.c
> @@ -369,7 +369,7 @@ static void mtdoops_notify_add(struct mtd_info *mtd)
>  
>  	/* oops_page_used is a bit field */
>  	cxt->oops_page_used = vmalloc(DIV_ROUND_UP(mtdoops_pages,
> -			BITS_PER_LONG));
> +			BITS_PER_LONG) * sizeof(unsigned long));

But it is already in bytes. I do not understand which problem this patch
fixes - it looks incorrect to me.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20111204/a96b926e/attachment.sig>


More information about the linux-mtd mailing list