]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
video: fbdev: au1200fb: Return an error code if a memory allocation fails
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 9 Nov 2017 17:09:28 +0000 (18:09 +0100)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Thu, 9 Nov 2017 17:09:28 +0000 (18:09 +0100)
'ret' is known to be 0 at this point.
In case of memory allocation error in 'framebuffer_alloc()', return
-ENOMEM instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/au1200fb.c

index a5facc2ad90b9abc8f5734aa8cde06e6147530ab..7fa41026984de69a2285f283be59e67feb788988 100644 (file)
@@ -1680,8 +1680,10 @@ static int au1200fb_drv_probe(struct platform_device *dev)
 
                fbi = framebuffer_alloc(sizeof(struct au1200fb_device),
                                        &dev->dev);
-               if (!fbi)
+               if (!fbi) {
+                       ret = -ENOMEM;
                        goto failed;
+               }
 
                _au1200fb_infos[plane] = fbi;
                fbdev = fbi->par;