* [PATCH] nvmem: layouts: onie-tlv: fix hang on unknown types
@ 2026-05-07 17:18 Andre Heider
2026-05-07 18:15 ` Miquel Raynal
0 siblings, 1 reply; 5+ messages in thread
From: Andre Heider @ 2026-05-07 17:18 UTC (permalink / raw)
To: Miquel Raynal, Srinivas Kandagatla; +Cc: linux-kernel
The EEPROM on my board has a vendor specific entry of type 0x41. When
stumbling upon that, this driver hangs in an endless loop.
Fix it by keep inrementing the offset on unknown entries, so the loop
will eventually stop.
Signed-off-by: Andre Heider <a.heider@gmail.com>
---
drivers/nvmem/layouts/onie-tlv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c
index 0967a32319a28..8b0f3c1b8a0e9 100644
--- a/drivers/nvmem/layouts/onie-tlv.c
+++ b/drivers/nvmem/layouts/onie-tlv.c
@@ -119,7 +119,7 @@ static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
cell.name = onie_tlv_cell_name(tlv.type);
if (!cell.name)
- continue;
+ goto next;
cell.offset = hdr_len + offset + sizeof(tlv.type) + sizeof(tlv.len);
cell.bytes = tlv.len;
@@ -132,6 +132,7 @@ static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
return ret;
}
+next:
offset += sizeof(tlv) + tlv.len;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] nvmem: layouts: onie-tlv: fix hang on unknown types
2026-05-07 17:18 [PATCH] nvmem: layouts: onie-tlv: fix hang on unknown types Andre Heider
@ 2026-05-07 18:15 ` Miquel Raynal
2026-05-08 5:50 ` [PATCH v2] " Andre Heider
0 siblings, 1 reply; 5+ messages in thread
From: Miquel Raynal @ 2026-05-07 18:15 UTC (permalink / raw)
To: Andre Heider; +Cc: Srinivas Kandagatla, linux-kernel
Hi Andre,
On 07/05/2026 at 19:18:59 +02, Andre Heider <a.heider@gmail.com> wrote:
> The EEPROM on my board has a vendor specific entry of type 0x41. When
> stumbling upon that, this driver hangs in an endless loop.
>
> Fix it by keep inrementing the offset on unknown entries, so the loop
> will eventually stop.
>
> Signed-off-by: Andre Heider <a.heider@gmail.com>
Needs a fixes tag, otherwise:
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] nvmem: layouts: onie-tlv: fix hang on unknown types
2026-05-07 18:15 ` Miquel Raynal
@ 2026-05-08 5:50 ` Andre Heider
2026-05-19 15:16 ` Srinivas Kandagatla
2026-05-19 15:17 ` Srinivas Kandagatla
0 siblings, 2 replies; 5+ messages in thread
From: Andre Heider @ 2026-05-08 5:50 UTC (permalink / raw)
To: miquel.raynal; +Cc: linux-kernel, srini
The EEPROM on my board has a vendor specific entry of type 0x41. When
stumbling upon that, this driver hangs in an endless loop.
Fix it by keep incrementing the offset on unknown entries, so the loop
will eventually stop.
Fixes: d3c0d12f6474 ("nvmem: layouts: onie-tlv: Add new layout driver")
Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
Thanks for the quick review, Miquel!
Added the Fixes: tag as requested, it dates back to the initial commit.
Regards,
Andre
drivers/nvmem/layouts/onie-tlv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c
index 0967a32319a28..8b0f3c1b8a0e9 100644
--- a/drivers/nvmem/layouts/onie-tlv.c
+++ b/drivers/nvmem/layouts/onie-tlv.c
@@ -119,7 +119,7 @@ static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
cell.name = onie_tlv_cell_name(tlv.type);
if (!cell.name)
- continue;
+ goto next;
cell.offset = hdr_len + offset + sizeof(tlv.type) + sizeof(tlv.len);
cell.bytes = tlv.len;
@@ -132,6 +132,7 @@ static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
return ret;
}
+next:
offset += sizeof(tlv) + tlv.len;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] nvmem: layouts: onie-tlv: fix hang on unknown types
2026-05-08 5:50 ` [PATCH v2] " Andre Heider
@ 2026-05-19 15:16 ` Srinivas Kandagatla
2026-05-19 15:17 ` Srinivas Kandagatla
1 sibling, 0 replies; 5+ messages in thread
From: Srinivas Kandagatla @ 2026-05-19 15:16 UTC (permalink / raw)
To: Andre Heider, miquel.raynal; +Cc: linux-kernel, srini
On 5/8/26 6:50 AM, Andre Heider wrote:
> The EEPROM on my board has a vendor specific entry of type 0x41. When
> stumbling upon that, this driver hangs in an endless loop.
>
> Fix it by keep incrementing the offset on unknown entries, so the loop
> will eventually stop.
>
> Fixes: d3c0d12f6474 ("nvmem: layouts: onie-tlv: Add new layout driver")
This needs Stable tag as well, Am applying this for now but, pl make
sure that a Stable tag is added to fixes next time.
--srini
> Signed-off-by: Andre Heider <a.heider@gmail.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>
> Thanks for the quick review, Miquel!
>
> Added the Fixes: tag as requested, it dates back to the initial commit.
>
> Regards,
> Andre
>
> drivers/nvmem/layouts/onie-tlv.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c
> index 0967a32319a28..8b0f3c1b8a0e9 100644
> --- a/drivers/nvmem/layouts/onie-tlv.c
> +++ b/drivers/nvmem/layouts/onie-tlv.c
> @@ -119,7 +119,7 @@ static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
>
> cell.name = onie_tlv_cell_name(tlv.type);
> if (!cell.name)
> - continue;
> + goto next;
>
> cell.offset = hdr_len + offset + sizeof(tlv.type) + sizeof(tlv.len);
> cell.bytes = tlv.len;
> @@ -132,6 +132,7 @@ static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
> return ret;
> }
>
> +next:
> offset += sizeof(tlv) + tlv.len;
> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] nvmem: layouts: onie-tlv: fix hang on unknown types
2026-05-08 5:50 ` [PATCH v2] " Andre Heider
2026-05-19 15:16 ` Srinivas Kandagatla
@ 2026-05-19 15:17 ` Srinivas Kandagatla
1 sibling, 0 replies; 5+ messages in thread
From: Srinivas Kandagatla @ 2026-05-19 15:17 UTC (permalink / raw)
To: miquel.raynal, Andre Heider; +Cc: linux-kernel
On Fri, 08 May 2026 07:50:00 +0200, Andre Heider wrote:
> The EEPROM on my board has a vendor specific entry of type 0x41. When
> stumbling upon that, this driver hangs in an endless loop.
>
> Fix it by keep incrementing the offset on unknown entries, so the loop
> will eventually stop.
>
>
> [...]
Applied, thanks!
[1/1] nvmem: layouts: onie-tlv: fix hang on unknown types
commit: 7749044c03a3af8b0f777183710487deb426b651
Best regards,
--
Srinivas Kandagatla <srini@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-19 15:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 17:18 [PATCH] nvmem: layouts: onie-tlv: fix hang on unknown types Andre Heider
2026-05-07 18:15 ` Miquel Raynal
2026-05-08 5:50 ` [PATCH v2] " Andre Heider
2026-05-19 15:16 ` Srinivas Kandagatla
2026-05-19 15:17 ` Srinivas Kandagatla
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.