lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 26 Jul 2014 12:19:17 +0200
From:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
To:	Wang YanQing <udknight@...il.com>,
	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	Tomi Valkeinen <tomi.valkeinen@...com>,
	Jingoo Han <jg1.han@...sung.com>,
	David Fries <David@...es.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Joe Perches <joe@...ches.com>,
	Linux Fbdev development list <linux-fbdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Pavel Machek <pavel@....cz>
Subject: Re: [PATCH v2] video: fbdev: uvesafb.c: Added additional error checking

2014-07-24 19:36 GMT+02:00 Wang YanQing <udknight@...il.com>:
> On Wed, Jul 23, 2014 at 11:20:27PM +0200, Rickard Strandqvist wrote:
>> Variable was assigned a value that is never used.
>> Now the variable is used, and the function returns if a call to
>> uvesafb_exec() returns a error.
>
> Because the only user of uvesafb_vbe_getpmi in uvesafb.c
> don't check its return value, it should do the check indeed,
> so maybe below change is better:
>
> -       if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
> +       if (err || (task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
>                 par->pmi_setpal = par->ypan = 0;
>         }
>
> Or we check uvesafb_vbe_getpmi's return value, then the code will looks like below:
>
> if (uvesafb_vbe_getpmi(task, par))
>     par->pmi_setpal = par->ypan = 0;


Hi

Sure, I saw that much of the other code using something like:
if (err || ...)


But this whole discussion start with that you wished it would return
the error, and then error code I assumed?

Ok, but something like this then?

err = uvesafb_exec(task);
if (err) {
  par->pmi_setpal = par->ypan = 0;
  return err;
}


Kind regards
Rickard Strandqvist
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists