summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schultz <[email protected]>2025-11-24 00:25:05 -0800
committerTom Rini <[email protected]>2025-12-07 08:07:07 -0600
commit9ce3d264e3b79b91d997eaa89dcd51488259c2b9 (patch)
treeb4014f853140dfc270be3142c48bbd649107a485
parente8c10f9d2446d66f56fc3621752c995dd6e99192 (diff)
board: phytec: phytec_som_detection: Add missing assignment
Assign the return value of snprintf (total length) to a variable to properly check if the string has the correct length. Currently, this variable is always zero and the length check after snprintf will always fail. Signed-off-by: Daniel Schultz <[email protected]>
-rw-r--r--board/phytec/common/phytec_som_detection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/board/phytec/common/phytec_som_detection.c b/board/phytec/common/phytec_som_detection.c
index 136f4486eb0..ff1711c24b4 100644
--- a/board/phytec/common/phytec_som_detection.c
+++ b/board/phytec/common/phytec_som_detection.c
@@ -346,8 +346,8 @@ static int phytec_get_part_number(struct phytec_eeprom_data *data,
return 0;
}
if (api2->som_type <= 3) {
- snprintf(part, PHYTEC_PART_NUMBER_MAX_LEN + 1, "%s.%s",
- product_name, api2->bom_rev);
+ len = snprintf(part, PHYTEC_PART_NUMBER_MAX_LEN + 1, "%s.%s",
+ product_name, api2->bom_rev);
if (len != PHYTEC_PART_NUMBER_KSP_LEN)
return -EINVAL;
return 0;