From: Wang YanQing <udknight@gmail.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
Jingoo Han <jg1.han@samsung.com>, David Fries <David@Fries.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Joe Perches <joe@perches.com>,
linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] video: fbdev: uvesafb.c: Added additional error checking
Date: Thu, 24 Jul 2014 17:31:12 +0000 [thread overview]
Message-ID: <20140724173112.GA2015@udknight> (raw)
In-Reply-To: <1406150427-26077-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
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.
WARNING: multiple messages have this Message-ID (diff)
From: Wang YanQing <udknight@gmail.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
Jingoo Han <jg1.han@samsung.com>, David Fries <David@Fries.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Joe Perches <joe@perches.com>,
linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] video: fbdev: uvesafb.c: Added additional error checking
Date: Fri, 25 Jul 2014 01:31:12 +0800 [thread overview]
Message-ID: <20140724173112.GA2015@udknight> (raw)
In-Reply-To: <1406150427-26077-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
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.
next prev parent reply other threads:[~2014-07-24 17:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-23 21:20 [PATCH v2] video: fbdev: uvesafb.c: Added additional error checking Rickard Strandqvist
2014-07-23 21:20 ` Rickard Strandqvist
2014-07-24 17:31 ` Wang YanQing [this message]
2014-07-24 17:31 ` Wang YanQing
2014-07-24 17:36 ` Wang YanQing
2014-07-24 17:36 ` Wang YanQing
2014-07-26 10:19 ` Rickard Strandqvist
2014-07-26 10:19 ` Rickard Strandqvist
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=20140724173112.GA2015@udknight \
--to=udknight@gmail.com \
--cc=David@Fries.net \
--cc=gregkh@linuxfoundation.org \
--cc=jg1.han@samsung.com \
--cc=joe@perches.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=tomi.valkeinen@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.