diff options
| author | Kory Maincent (TI.com) <[email protected]> | 2025-10-30 17:45:06 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-03 10:02:39 -0600 |
| commit | 37c6cdb053573587afb57e09a2f5096b4b71c442 (patch) | |
| tree | 737cb856f1d7544e3a506d22fd84c46713d1a95c | |
| parent | 53e14e9c0c606f0684a3ddb09afebe4b5eb89926 (diff) | |
board: sandbox: Improve extension board scan implementation
Enhance the extension board scanning code in sandbox with better error
handling and code organization.
Signed-off-by: Kory Maincent (TI.com) <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
| -rw-r--r-- | board/sandbox/sandbox.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c index 0dc23a27dfc..c5d7b9651a9 100644 --- a/board/sandbox/sandbox.c +++ b/board/sandbox/sandbox.c @@ -113,11 +113,15 @@ int ft_board_setup(void *fdt, struct bd_info *bd) #ifdef CONFIG_CMD_EXTENSION int extension_board_scan(struct list_head *extension_list) { - struct extension *extension; int i; for (i = 0; i < 2; i++) { + struct extension *extension; + extension = calloc(1, sizeof(struct extension)); + if (!extension) + return -ENOMEM; + snprintf(extension->overlay, sizeof(extension->overlay), "overlay%d.dtbo", i); snprintf(extension->name, sizeof(extension->name), "extension board %d", i); snprintf(extension->owner, sizeof(extension->owner), "sandbox"); |
