mirror of
https://xff.cz/git/u-boot/
synced 2025-09-06 19:22:11 +02:00
fdt: Check for NULL return from fdt_getprop in 'fdt set'
While the previous pass through fixed one place where we knew that
fdt_getprop would be given a positive len, in the case of 'fdt set' we
do not, so check that we did no get NULL from fdt_getprop().
Cc: Simon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 163249)
Fixes 72c98ed1ab
("fdt: Add a check to do_fdt() for coverity")
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -284,6 +284,10 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||||||
len = 0;
|
len = 0;
|
||||||
} else {
|
} else {
|
||||||
ptmp = fdt_getprop(working_fdt, nodeoffset, prop, &len);
|
ptmp = fdt_getprop(working_fdt, nodeoffset, prop, &len);
|
||||||
|
if (!ptmp) {
|
||||||
|
printf("prop (%s) not found!\n", prop);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if (len > SCRATCHPAD) {
|
if (len > SCRATCHPAD) {
|
||||||
printf("prop (%d) doesn't fit in scratchpad!\n",
|
printf("prop (%d) doesn't fit in scratchpad!\n",
|
||||||
len);
|
len);
|
||||||
|
Reference in New Issue
Block a user