[PATCH v4 07/11] net/bnxt/tf_ulp: fix minsize build
Thomas Monjalon
thomas at monjalon.net
Thu Feb 5 22:27:39 CET 2026
This error is seen in build of type "minsize":
In function 'ulp_blob_append':
error: 'num' may be used uninitialized [-Werror=maybe-uninitialized]
drivers/net/bnxt/tf_ulp/ulp_utils.h:1109:13:
note: in expansion of macro 'unlikely'
1109 | if (unlikely((src_offset + src_len) > num))
| ^~~~~~~~
drivers/net/bnxt/tf_ulp/ulp_utils.h:1105:18: note: 'num' was declared here
1105 | uint16_t num;
Indeed num may be not initialized if ulp_blob_data_get() fails.
It is fixed by checking the return value src_buf.
Fixes: 0c036a1485b9 ("net/bnxt/tf_ulp: optimize with inline and prediction")
Cc: stable at dpdk.org
Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
drivers/net/bnxt/tf_ulp/ulp_utils.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/bnxt/tf_ulp/ulp_utils.h b/drivers/net/bnxt/tf_ulp/ulp_utils.h
index 7a8145b5df..ce20f1916f 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_utils.h
+++ b/drivers/net/bnxt/tf_ulp/ulp_utils.h
@@ -1106,6 +1106,8 @@ ulp_blob_append(struct ulp_blob *dst, struct ulp_blob *src,
uint8_t bluff;
uint8_t *src_buf = ulp_blob_data_get(src, &num);
+ if (unlikely(src_buf == NULL))
+ return -EINVAL;
if (unlikely((src_offset + src_len) > num))
return -EINVAL;
--
2.52.0
More information about the stable
mailing list