aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Shved <shved@ispras.ru>2011-06-17 12:25:12 -0400
committerPaul Mundt <lethal@linux-sh.org>2011-06-24 04:00:39 -0400
commit291600193e5c0c3f0a9af1f23a8076dd7417c02a (patch)
tree94d64fc90e5bd5de69ce4b9e0df0b169db82b544
parent9845afc8fa32de145d56c8e69b7900e10371255d (diff)
hecubafb: add module_put on error path in hecubafb_probe()
In hecubafb_probe(), after a successful try_module_get, vzalloc may fail and make the hecubafb_probe return, but the module is not put on this error path. This patch adds an exit point that calls module_put in such situation. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Pavel Shved <shved@ispras.ru> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--drivers/video/hecubafb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index fbef15f7a21..614251a9af9 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -233,7 +233,7 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
233 233
234 videomemory = vzalloc(videomemorysize); 234 videomemory = vzalloc(videomemorysize);
235 if (!videomemory) 235 if (!videomemory)
236 return retval; 236 goto err_videomem_alloc;
237 237
238 info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev); 238 info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev);
239 if (!info) 239 if (!info)
@@ -275,6 +275,7 @@ err_fbreg:
275 framebuffer_release(info); 275 framebuffer_release(info);
276err_fballoc: 276err_fballoc:
277 vfree(videomemory); 277 vfree(videomemory);
278err_videomem_alloc:
278 module_put(board->owner); 279 module_put(board->owner);
279 return retval; 280 return retval;
280} 281}