mirror of
https://github.com/raspberrypi/userland.git
synced 2025-12-06 04:49:12 +00:00
libfdt: Add null-ptr check for prop-data to resolve clang --analyzer warning
This commit is contained in:
@@ -268,6 +268,9 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,
|
|||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
if (!prop_data)
|
||||||
|
return -FDT_ERR_NOTFOUND;
|
||||||
|
|
||||||
if (len)
|
if (len)
|
||||||
memcpy(prop_data, val, len);
|
memcpy(prop_data, val, len);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user