Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dpll: fix clock quality level reporting

The DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EPRC is not reported via netlink
due to bug in dpll_msg_add_clock_quality_level(). The usage of
DPLL_CLOCK_QUALITY_LEVEL_MAX for both DECLARE_BITMAP() and
for_each_set_bit() is not correct because these macros requires bitmap
size and not the highest valid bit in the bitmap.

Use correct bitmap size to fix this issue.

Fixes: a1afb959add1 ("dpll: add clock quality level attribute and op")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Link: https://patch.msgid.link/20250912093331.862333-1-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Ivan Vecera and committed by
Jakub Kicinski
70d99623 2e7bba08

+2 -2
+2 -2
drivers/dpll/dpll_netlink.c
··· 211 211 dpll_msg_add_clock_quality_level(struct sk_buff *msg, struct dpll_device *dpll, 212 212 struct netlink_ext_ack *extack) 213 213 { 214 + DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1) = { 0 }; 214 215 const struct dpll_device_ops *ops = dpll_device_ops(dpll); 215 - DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX) = { 0 }; 216 216 enum dpll_clock_quality_level ql; 217 217 int ret; 218 218 ··· 221 221 ret = ops->clock_quality_level_get(dpll, dpll_priv(dpll), qls, extack); 222 222 if (ret) 223 223 return ret; 224 - for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX) 224 + for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1) 225 225 if (nla_put_u32(msg, DPLL_A_CLOCK_QUALITY_LEVEL, ql)) 226 226 return -EMSGSIZE; 227 227