mirror of
https://github.com/apache/nuttx.git
synced 2026-09-08 18:06:33 +00:00
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:
parent
75d62344c2
commit
b6f3f2eedc
2 changed files with 20 additions and 1 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue