History

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.

Wang YanQing committed 13 years ago

Commit 090da751 parent 477fc031 file · +2 −1Browse files

Unified · Split

drivers/video/uvesafb.c+2−1
@@ -1973,7 +1973,8 @@ static int uvesafb_init(void) · 1972 unmodified lines
19731973 err = -ENOMEM;
19741974
19751975 if (err) {
1976− platform_device_put(uvesafb_device);
1976+ if (uvesafb_device)
1977+ platform_device_put(uvesafb_device);
19771978 platform_driver_unregister(&uvesafb_driver);
19781979 cn_del_callback(&uvesafb_cn_id);
19791980 return err;