From: Wang YanQing Date: Sat, 30 Mar 2013 02:53:00 +0000 (+0200) Subject: video:uvesafb: Fix dereference NULL pointer code path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=090da752cdd6f0786eee68c8dea8db7c8abd3798;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Tomi Valkeinen --- 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;