video:uvesafb: Fix dereference NULL pointer code path
Changes
1 files changed · +2 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| drivers/video/uvesafb.c | modified | +2 | −1 | View file |
drivers/video/uvesafb.c
View filediff --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;