aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jarzmik <[email protected]>2015-12-19 13:14:31 +0100
committerTomi Valkeinen <[email protected]>2016-01-18 10:26:17 +0200
commit6f6abd360603aff043352db90c28748c8c46560e (patch)
treee9ccd190c70cbe9a4d79d91f0fad5f380bf51a57
parentcaf05780f6ed5eb7fe168dbabd9a8d7cfb45d89b (diff)
video: fbdev: pxafb: fix out of memory error path
As seen by Julia, the initial allocation memory is not checked anymore after commit "video: fbdev: pxafb: initial devicetree conversion". Introduce back the removed test. Reported-by: Julia Lawall <[email protected]> Signed-off-by: Robert Jarzmik <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
-rw-r--r--drivers/video/fbdev/pxafb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index 987eb8c4f926..33b2bb315a2a 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2249,6 +2249,8 @@ static int pxafb_probe(struct platform_device *dev)
ret = -ENOMEM;
pdata = dev_get_platdata(&dev->dev);
inf = devm_kmalloc(&dev->dev, sizeof(*inf), GFP_KERNEL);
+ if (!inf)
+ goto failed;
if (pdata) {
*inf = *pdata;