<div dir="auto">one more reason to have common code for boolean flags. there is a bigish series to do that</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Oct 29, 2026, 22:17 Nawal Kishor <<a href="mailto:nkishor@marvell.com">nkishor@marvell.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">parse_halo_ena_handler() kept the parsed value in a uint8_t and stored<br>
it through a uint8_t pointer, while the caller passes a uint32_t. The<br>
narrowing happened before the 0/1 check, so 256 was accepted as 0 and<br>
257 as 1. The one-byte store also updated only the first byte of that<br>
uint32_t, which is correct only on a little-endian host when the local<br>
is already zero.<br>
<br>
Parse and store a uint32_t so the check sees the full value and the<br>
caller's object is written completely.<br>
<br>
Fixes: 45abbfc836b1 ("mempool/cnxk: support HALO in mempool")<br>
<br>
Signed-off-by: Nawal Kishor <<a href="mailto:nkishor@marvell.com" target="_blank" rel="noreferrer">nkishor@marvell.com</a>><br>
---<br>
drivers/mempool/cnxk/cnxk_mempool.c | 4 ++--<br>
1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/mempool/cnxk/cnxk_mempool.c b/drivers/mempool/cnxk/cnxk_mempool.c<br>
index 6939fccff4..f1cdf9cbb5 100644<br>
--- a/drivers/mempool/cnxk/cnxk_mempool.c<br>
+++ b/drivers/mempool/cnxk/cnxk_mempool.c<br>
@@ -51,13 +51,13 @@ static int<br>
parse_halo_ena_handler(const char *key, const char *value, void *extra_args)<br>
{<br>
RTE_SET_USED(key);<br>
- uint8_t val;<br>
+ uint32_t val;<br>
<br>
val = atoi(value);<br>
if (val != 0 && val != 1)<br>
return -EINVAL;<br>
<br>
- *(uint8_t *)extra_args = val;<br>
+ *(uint32_t *)extra_args = val;<br>
return 0;<br>
}<br>
<br>
-- <br>
2.48.1<br>
<br>
</blockquote></div>