linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
To: linux-fbdev@vger.kernel.org
Subject: Re: [patch] video: mb862xxfb: prevent divide by zero bug
Date: Thu, 23 Aug 2012 20:30:43 +0000	[thread overview]
Message-ID: <503692F3.40402@gmx.de> (raw)
In-Reply-To: <20120818155541.GB22424@elgon.mountain>

On 08/18/2012 03:55 PM, Dan Carpenter wrote:
> Do a sanity check on these before using them as divisors.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
> index 00ce1f3..57d940b 100644
> --- a/drivers/video/mb862xx/mb862xxfbdrv.c
> +++ b/drivers/video/mb862xx/mb862xxfbdrv.c
> @@ -328,6 +328,8 @@ static int mb862xxfb_ioctl(struct fb_info *fbi, unsigned int cmd,
>  	case MB862XX_L1_SET_CFG:
>  		if (copy_from_user(l1_cfg, argp, sizeof(*l1_cfg)))
>  			return -EFAULT;
> +		if (l1_cfg->dh = 0 || l1_cfg->dw = 0)
> +			return -EINVAL;
>  		if ((l1_cfg->sw >= l1_cfg->dw) && (l1_cfg->sh >= l1_cfg->dh)) {
>  			/* downscaling */
>  			outreg(cap, GC_CAP_CSC,
> 


      parent reply	other threads:[~2012-08-23 20:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-18 15:55 [patch] video: mb862xxfb: prevent divide by zero bug Dan Carpenter
     [not found] ` <20120818155541.GB22424-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2012-08-18 18:35   ` Anatolij Gustschin
2012-08-23 20:30 ` Florian Tobias Schandinat [this message]

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=503692F3.40402@gmx.de \
    --to=florianschandinat@gmx.de \
    --cc=linux-fbdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).