[Concept,01/18] efi: Add missing break statements in dp_size()

Message ID 20250820004039.3920254-2-sjg@u-boot.org
State New
Headers
Series efi: Move towards the EFI app booting EFI applications |

Commit Message

Simon Glass Aug. 20, 2025, 12:40 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

The conversion to using a size variable was missing a break statement
for the BLK case. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: ffde1a39228 ("efi: Use variables in dp_size()")
---

 lib/efi/device_path.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/lib/efi/device_path.c b/lib/efi/device_path.c
index 4c2c0bb614f..d1fdd0fba81 100644
--- a/lib/efi/device_path.c
+++ b/lib/efi/device_path.c
@@ -328,7 +328,7 @@  bool efi_dp_is_multi_instance(const struct efi_device_path *dp)
 
 __maybe_unused static unsigned int dp_size(struct udevice *dev)
 {
-	uint parent_size, size;
+	uint parent_size, size = 0;
 
 	if (!dev || !dev->driver)
 		return sizeof(struct efi_device_path_udevice);
@@ -374,6 +374,7 @@  __maybe_unused static unsigned int dp_size(struct udevice *dev)
 			size = sizeof(struct efi_device_path_udevice);
 			break;
 		}
+		break;
 	case UCLASS_MMC:
 		if (IS_ENABLED(CONFIG_MMC))
 			size = sizeof(struct efi_device_path_sd_mmc_path);