linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: skeletonfb.c:  Adding code to managing allocation error
@ 2014-06-21 13:17 Rickard Strandqvist
  2014-06-21 13:58 ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Rickard Strandqvist @ 2014-06-21 13:17 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Daniel Vetter, Joe Perches,
	linux-fbdev, linux-kernel

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 <rickard_strandqvist@spectrumdigital.se>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-21 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-21 13:17 [PATCH] video: fbdev: skeletonfb.c: Adding code to managing allocation error Rickard Strandqvist
2014-06-21 13:58 ` Joe Perches
2014-06-21 20:48   ` Geert Uytterhoeven
2014-06-21 21:32     ` Rickard Strandqvist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).