[PATCH] add a check to prevent the incrementing of possible NULL value for "region" in onenand_base.c

john.maxin at nokia.com john.maxin at nokia.com
Fri May 6 04:33:02 EDT 2011


Hi Artem,

>The commit message should not contain that long lines - use max 80
>lines. The commit message should not start with "Hi". The subject should
>be short and more high level - the details go to the commit message.
>Could you please improve this and re-submit?

Oops.. I am sorry. Thanks a lot for pointing out my mistakes.
I will make the modifications as per your instruction and will resubmit the patch.  

Thanks and Regards,
Maxin 
_______________________________________
From: ext Artem Bityutskiy [dedekind1 at gmail.com]
Sent: Thursday, May 05, 2011 8:51 PM
To: Maxin John (Nokia-SD/Helsinki)
Cc: linux-mtd at lists.infradead.org; kyungmin.park at samsung.com; dwmw2 at infradead.org
Subject: Re: [PATCH] add a check to prevent the incrementing of possible NULL value for "region" in onenand_base.c

On Wed, 2011-05-04 at 11:26 +0000, john.maxin at nokia.com wrote:
> Hi,
>
> Coverity has reported that inside the function "onenand_block_by_block_erase()" in onenand_base.c, we should add checks to prevent the incrementing of possible NULL value for "region"
> Thanks a lot to Adrian Hunter for suggesting a better solution.
>
> Signed-off-by: Maxin B. John <john.maxin at nokia.com>
> diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
> index 56a8b20..fd659f8 100644
> --- a/drivers/mtd/onenand/onenand_base.c
> +++ b/drivers/mtd/onenand/onenand_base.c
> @@ -2424,7 +2424,7 @@ static int onenand_block_by_block_erase(struct mtd_info *mtd,
>                 len -= block_size;
>                 addr += block_size;
>
> -               if (addr == region_end) {
> +               if (region && addr == region_end) {
>                         if (!len)
>                                 break;
>                         region++;
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/





More information about the linux-mtd mailing list