drm:vkms: Add NULL value after free function In function vkms_exit, after kfree(default_config), give specific NULL value to pointer default_config to avoid wild pointer.
PATCH 1/1 drm:vkms: Add NULL value after free function In function vkms_exit, after kfree(default_config), give specific NULL value to pointer default_config to avoid wild pointer.
Signed-off-by Hao Peng <[email protected]>
--- drivers/gpu/drm/vkms/vkms_drv.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/vkms/vkms_drv.c +1 -0
@@ -227,6 +227,7 @@ static void __exit vkms_exit(void)vkms_destroy (default_config);kfree (default_config); + default_config =NULL ; }module_init (vkms_init);
Signature · 1 line
2.20.1
Quoted 10 lines · Hao Peng
Signed-off-by Hao Peng <[email protected]>--- drivers/gpu/drm/vkms/vkms_drv.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/vkms/vkms_drv.c +0
-0
drivers/gpu/drm/vkms/vkms_drv.c static void __exit vkms_exit(void) · line 230
Quoted 4 lines
drivers/gpu/drm/vkms/vkms_drv.c +1
-0@@ -227,6 +227,7 @@ static void __exit vkms_exit(void)vkms_destroy (default_config);kfree (default_config); + default_config =NULL ;
This is the last thing before the module us unloaded, which means no one can access default_config anymore. So also no point in clearing it. -Daniel
Quoted 8 lines
drivers/gpu/drm/vkms/vkms_drv.c +0
-0}module_init (vkms_init);Signature · 1 line
2.20.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch