Commit Graph

5 Commits

Author SHA1 Message Date
G S Niteesh Babu
8b32f1d8c4 bsps/shared/ofw: Bug fixes
Fixed bugs in rtems_ofw_get_prop, rtems_ofw_get_prop_len
and removed hardcoded value.
2021-02-08 21:08:36 +01:00
G S Niteesh Babu
6da50db55b bsps/shared/ofw: Make rtems_ofw_get_effective_phandle iterative
Refactored recursive rtems_ofw_get_effective_phandle into a
iterative function.
2021-02-08 21:08:36 +01:00
G S Niteesh Babu
066687c43a bsps/shared/ofw: Use strlcpy instead of strncpy
Changed rtems_ofw_get_prop to use strlcpy instead of strncpy
to ensure the buffer is null terminated incase of overflow.
2021-02-08 21:08:36 +01:00
G S Niteesh Babu
c4985b7718 bsps/shared/ofw: Fix coverity reported defects
Fixed use after free and null pointer dereference defects

FIXES:
1) CID 1472601 (NULL_RETURNS)
2) CID 1472600 (USE_AFTER_FREE)
3) CID 1472599 (USE_AFTER_FREE)
4) CID 1472598 (USE_AFTER_FREE)
5) CID 1472596 (USE_AFTER_FREE)

The below two defects have to marked false positive
1) CID 1472597 (ARRAY_VS_SINGLETON)
2) CID 1472595 (ARRAY_VS_SINGLETON)
2021-02-08 21:08:36 +01:00
G S Niteesh Babu
9d2ed41fcb bsps/shared/ofw: Implement RTEMS OFW interface
RTEMS OFW is a FDT only implementation of the OpenFirmWare
interface. This API is created to be compatible with FreeBSD
OpenFirmWare interface. The main intention is to make
porting of FreeBSD drivers to RTEMS easier.

Most functions implemented have an direct one-one mapping
with the original OFW API and some extra auxiliary functions
were implemented to make working with device trees easier in
RTEMS.

Update #3784
2020-12-27 10:05:02 +01:00