video: fbdev: grvga.c: Fix for possible null pointer dereference
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Tue, 20 May 2014 21:35:59 +0000 (23:35 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 23 May 2014 10:47:31 +0000 (13:47 +0300)
There is otherwise a risk of a possible null pointer dereference.

Was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/grvga.c

index c078701f15f6fcfc00a214986233bb3e54ce5aa5..2db5bb1a33e88363e478493346f75362e29a704a 100644 (file)
@@ -514,9 +514,10 @@ free_fb:
 static int grvga_remove(struct platform_device *device)
 {
        struct fb_info *info = dev_get_drvdata(&device->dev);
-       struct grvga_par *par = info->par;
+       struct grvga_par *par;
 
        if (info) {
+               par = info->par;
                unregister_framebuffer(info);
                fb_dealloc_cmap(&info->cmap);
 
This page took 0.027606 seconds and 5 git commands to generate.