mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
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 <julia.lawall@lip6.fr> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
parent
caf05780f6
commit
6f6abd3606
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue