cxd56_dmac, lcd_dev: fix null pointer dereference

Check return values of following functions for null:
   - board_lcd_getdev
   - get_device

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
This commit is contained in:
Mingjie Shen 2023-06-26 02:36:22 -04:00 committed by Alan Carvalho de Assis
parent 75d62344c2
commit b6f3f2eedc
2 changed files with 20 additions and 1 deletions

View file

@ -315,6 +315,12 @@ int lcddev_register(int devno)
}
priv->lcd_ptr = board_lcd_getdev(devno);
if (!priv->lcd_ptr)
{
ret = -ENODEV;
goto err;
}
ret = priv->lcd_ptr->getplaneinfo(priv->lcd_ptr, 0, &priv->planeinfo);
if (ret < 0)
{