summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/grvga.c
diff options
context:
space:
mode:
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>2014-05-20 23:35:59 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-05-23 12:47:31 +0200
commitd9a5f87c8fb49010d4fc1e41e263072b7e9916b1 (patch)
tree2ae228b1cf266c06458bfbd4763bdfd646b823af /drivers/video/fbdev/grvga.c
parentmatroxfb: perform a dummy read of M_STATUS (diff)
downloadlinux-d9a5f87c8fb49010d4fc1e41e263072b7e9916b1.tar.xz
linux-d9a5f87c8fb49010d4fc1e41e263072b7e9916b1.zip
video: fbdev: grvga.c: Fix for possible null pointer dereference
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>
Diffstat (limited to 'drivers/video/fbdev/grvga.c')
-rw-r--r--drivers/video/fbdev/grvga.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/video/fbdev/grvga.c b/drivers/video/fbdev/grvga.c
index c078701f15f6..2db5bb1a33e8 100644
--- a/drivers/video/fbdev/grvga.c
+++ b/drivers/video/fbdev/grvga.c
@@ -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);