Thread (4 messages) 4 messages, 3 authors, 2014-06-21

[PATCH] video: fbdev: skeletonfb.c: Adding code to managing allocation error

From: Rickard Strandqvist <hidden>
Date: 2014-06-21 13:16:30
Also in: lkml
Subsystem: framebuffer layer, the rest · Maintainers: Helge Deller, Linus Torvalds

Adding missing code for managing a memory allocation error that may occur.

This was partly found using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <redacted>
---
 drivers/video/fbdev/skeletonfb.c |    2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/video/fbdev/skeletonfb.c b/drivers/video/fbdev/skeletonfb.c
index fefde7c..ee6dc7e 100644
--- a/drivers/video/fbdev/skeletonfb.c
+++ b/drivers/video/fbdev/skeletonfb.c
@@ -692,6 +692,7 @@ static int xxxfb_probe(struct pci_dev *dev, const struct pci_device_id *ent)
 
     if (!info) {
 	    /* goto error path */
+	    return -ENOMEM;
     }
 
     par = info->par;
@@ -746,6 +747,7 @@ static int xxxfb_probe(struct pci_dev *dev, const struct pci_device_id *ent)
     info->pixmap.addr = kmalloc(PIXMAP_SIZE, GFP_KERNEL);
     if (!info->pixmap.addr) {
 	    /* goto error */
+	    return -ENOMEM;
     }
 
     info->pixmap.size = PIXMAP_SIZE;
-- 
1.7.10.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help