Changeset 6bc883b in rtems for cpukit/dtc/libfdt/fdt_ro.c


Ignore:
Timestamp:
Mar 25, 2018, 11:54:22 AM (21 months ago)
Author:
David Gibson <david@…>
Branches:
master
Children:
c81f432
Parents:
72273b6
git-author:
David Gibson <david@…> (03/25/18 11:54:22)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/19/18 05:01:12)
Message:

libfdt: Propagate name errors in fdt_getprop_by_offset()

fdt_getprop_by_offset() doesn't check for errors from fdt_string() - after
all, until very recently it couldn't fail. Now it can, so we need to
propagate errors up to the caller.

Signed-off-by: David Gibson <david@…>
Tested-by: Alexey Kardashevskiy <aik@…>
Reviewed-by: Alexey Kardashevskiy <aik@…>
Reviewed-by: Simon Glass <sjg@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/dtc/libfdt/fdt_ro.c

    r72273b6 r6bc883b  
    462462        if (!prop)
    463463                return NULL;
    464         if (namep)
    465                 *namep = fdt_string(fdt, fdt32_to_cpu(prop->nameoff));
     464        if (namep) {
     465                const char *name;
     466                int namelen;
     467                name = fdt_get_string(fdt, fdt32_to_cpu(prop->nameoff),
     468                                      &namelen);
     469                if (!name) {
     470                        if (lenp)
     471                                *lenp = namelen;
     472                        return NULL;
     473                }
     474                *namep = name;
     475        }
    466476
    467477        /* Handle realignment */
Note: See TracChangeset for help on using the changeset viewer.