aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/uvesafb.c
diff options
context:
space:
mode:
authorWang YanQing <udknight@gmail.com>2013-03-30 04:53:00 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-02 13:33:55 +0300
commit090da752cdd6f0786eee68c8dea8db7c8abd3798 (patch)
tree5b81a185bc34326ef9e120ca96fe271c3e589bba /drivers/video/uvesafb.c
parentfbmon: use VESA_DMT_VSYNC_HIGH to fix typo (diff)
downloadlinux-dev-090da752cdd6f0786eee68c8dea8db7c8abd3798.tar.xz
linux-dev-090da752cdd6f0786eee68c8dea8db7c8abd3798.zip
video:uvesafb: Fix dereference NULL pointer code path
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> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/uvesafb.c')
-rw-r--r--drivers/video/uvesafb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index b75db0186488..d4284458377e 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -1973,7 +1973,8 @@ static int 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;