Re: [PATCH v2] video: fbdev: uvesafb.c: Added additional error checking

From
Wang YanQing <udknight@gmail.com>
Date
2014-07-24 17:32:48
Also in
lkml
Reply to
Rickard Strandqvist, 2014-07-23
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;


Thanks.
Thread (4 messages) 4 messages, 2 authors, last reply 2014-07-26
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help