[PATCH] media: dvb-frontends: mxl5xx: Fix xpt_nco_clock_rate register fields
From: Daniel Scheller via B4 Relay
Date: Sun Nov 29 2026 - 16:24:48 EST
From: Daniel Scheller <d.scheller@xxxxxxx>
The xpt_nco_clock_rate array contains incorrectly resolved register field
definitions.
When the original register field macros were converted into explicit
values, the XPT_NCO_COUNT_MIN base definition was mistakenly used for all
eight entries, overlooking the individual XPT_NCO_COUNT_MIN0 through
XPT_NCO_COUNT_MIN7 definitions in the original register header.
As a result, the numeric suffixes were appended to the bit widths, causing
values ranging from 80 to 87, while all entries reference the same
incorrect register address and bit offset.
Resolve the original XPT_NCO_COUNT_MIN0 through XPT_NCO_COUNT_MIN7
definitions correctly to restore the intended register addresses, bit
offsets and field widths.
This also fixes the UBSAN-reported negative bit shift caused by the invalid
register field definitions.
Reported-by: Gero Graubner <j-l-p@xxxxxx>
Link: https://lore.kernel.org/linux-media/8b020d3b140ec3ac5036ee85ebf45f9796275d1e.camel@xxxxxx/
Fixes: 3c4e04153f9a ("media: dvb-frontends: MaxLinear MxL5xx DVB-S/S2 tuner-demodulator driver")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Daniel Scheller <d.scheller@xxxxxxx>
---
This fixes the UBSAN reported by Gero Graubner as reported via Link:. As
this very likely happens in earlier kernel versions aswell and the code
or rather table in question exists in unchanged form since the initial
merge around 4.15, I think this is a good candidate for a stable backport.
@Gero If you like, please try this patch and check if it fixes the issue
for you.
---
drivers/media/dvb-frontends/mxl5xx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/dvb-frontends/mxl5xx.c b/drivers/media/dvb-frontends/mxl5xx.c
index 64d83589dfc4..faa2ff63175b 100644
--- a/drivers/media/dvb-frontends/mxl5xx.c
+++ b/drivers/media/dvb-frontends/mxl5xx.c
@@ -1432,10 +1432,10 @@ static int config_ts(struct mxl *state, enum MXL_HYDRA_DEMOD_ID_E demod_id,
{0x907001D4, 4, 1}, {0x907001D4, 5, 1},
{0x907001D4, 6, 1}, {0x907001D4, 7, 1} };
static const struct MXL_REG_FIELD_T xpt_nco_clock_rate[MXL_HYDRA_DEMOD_MAX] = {
- {0x90700044, 16, 80}, {0x90700044, 16, 81},
- {0x90700044, 16, 82}, {0x90700044, 16, 83},
- {0x90700044, 16, 84}, {0x90700044, 16, 85},
- {0x90700044, 16, 86}, {0x90700044, 16, 87} };
+ {0x90700044, 16, 8}, {0x90700238, 0, 8},
+ {0x90700238, 8, 8}, {0x90700238, 16, 8},
+ {0x90700238, 24, 8}, {0x9070023C, 0, 8},
+ {0x9070023C, 8, 8}, {0x9070023C, 16, 8} };
demod_id = state->base->ts_map[demod_id];
---
base-commit: b7ac871daee981f1963f632586ff9b9d898ce5dd
change-id: 20261129-mxl5xx-fix-ncoclock-459d548d9f02
Best regards,
--
Daniel Scheller <d.scheller@xxxxxxx>