Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Mike Dunn <mikedunn@newsguy.com>,
	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	kernel-janitors@vger.kernel.org, linux-mtd@lists.infradead.org,
	Ivan Djelic <ivan.djelic@parrot.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [patch] mtg: docg3: potential divide by zero in doc_write_oob()
Date: Thu, 29 Nov 2012 19:46:54 +0100	[thread overview]
Message-ID: <87zk201c2p.fsf@free.fr> (raw)
In-Reply-To: <20121129141651.GA12199@elgon.mountain> (Dan Carpenter's message of "Thu, 29 Nov 2012 17:16:51 +0300")

Dan Carpenter <dan.carpenter@oracle.com> writes:

> If we set oobdelta to zero then we will either return -EINVAL or hit
> a divide (modulus) by zero on the next line when we check
> "(ooblen % oobdelta)".  It's better to just return -EINVAL here instead.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static analysis.  I don't know if it's actually possible to hit this
> condition.
I don't know any possibility to reach that condition, nonetheless the patch
makes the code more robust, therefore :

Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Cheers.

--
Robert

  reply	other threads:[~2012-11-29 18:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 14:16 [patch] mtg: docg3: potential divide by zero in doc_write_oob() Dan Carpenter
2012-11-29 18:46 ` Robert Jarzmik [this message]
2012-12-10 13:28 ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zk201c2p.fsf@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dwmw2@infradead.org \
    --cc=ivan.djelic@parrot.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mikedunn@newsguy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox