From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Wang YanQing <udknight@gmail.com>,
spock@gentoo.org, linux-fbdev@vger.kernel.org,
FlorianSchandinat@gmx.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH]video:uvesafb: Fix dereference NULL pointer code path
Date: Tue, 02 Apr 2013 10:34:43 +0000 [thread overview]
Message-ID: <515AB443.4060407@ti.com> (raw)
In-Reply-To: <20130330025330.GA25246@udknight>
[-- Attachment #1: Type: text/plain, Size: 860 bytes --]
On 2013-03-30 04:53, Wang YanQing wrote:
> platform_device_alloc could failed and return NULL,
> we should check this before call platform_device_put.
>
> Signed-off-by: Wang YanQing <udknight@gmail.com>
> ---
> drivers/video/uvesafb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
> index 2f8f82d..230bd45 100644
> --- a/drivers/video/uvesafb.c
> +++ b/drivers/video/uvesafb.c
> @@ -1975,7 +1975,8 @@ static int __devinit uvesafb_init(void)
> err = -ENOMEM;
>
> if (err) {
> - platform_device_put(uvesafb_device);
> + if (uvesafb_device)
> + platform_device_put(uvesafb_device);
> platform_driver_unregister(&uvesafb_driver);
> cn_del_callback(&uvesafb_cn_id);
> return err;
>
Thanks, queued to fbdev fixes.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]
next prev parent reply other threads:[~2013-04-02 10:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-30 2:53 [PATCH]video:uvesafb: Fix dereference NULL pointer code path Wang YanQing
2013-04-02 10:34 ` Tomi Valkeinen [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-01-27 6:13 Wang YanQing
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=515AB443.4060407@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=FlorianSchandinat@gmx.de \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=spock@gentoo.org \
--cc=udknight@gmail.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;
as well as URLs for NNTP newsgroup(s).