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
1973 err = -ENOMEM;1973 err = -ENOMEM;
1974 1974
1975 if (err) {1975 if (err) {
1976 platform_device_put(uvesafb_device);1976 if (uvesafb_device)
1977 platform_device_put(uvesafb_device);
1977 platform_driver_unregister(&uvesafb_driver);1978 platform_driver_unregister(&uvesafb_driver);
1978 cn_del_callback(&uvesafb_cn_id);1979 cn_del_callback(&uvesafb_cn_id);
1979 return err;1980 return err;