projects/linux·commit 090da752

video:uvesafb: Fix dereference NULL pointer code path

090da752 · Wang YanQing <[email protected]> · 2013-03-30 04:53:00 +02:00

platform_device_alloc could failed and return NULL,
we should check this before call platform_device_put.

Signed-off-by: Wang YanQing <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Commit
090da752cdd6f0786eee68c8dea8db7c8abd3798
Parents
477fc03f

Changes

1 files changed · +2 −1

FileStatusAddDelContent
drivers/video/uvesafb.cmodified+2−1View file

drivers/video/uvesafb.c

View file
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index b75db01..d428445 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;