dpll: Add an assertion to check freq_supported_num
Subsystems (4)
PATCH v4 1/1 dpll: Add an assertion to check freq_supported_num
Since the driver is broken in the case that src->freq_supported is not NULL but src->freq_supported_num is 0, add an assertion for it.
---
Changelog:
v3 -> v4:
1. Add return after WARN_ON().
v2 -> v3:
1. Add "net-next" to the subject.
2. Remove the "Fixes" tag and "Cc: stable".
3. Replace BUG_ON with WARN_ON.
v1 -> v2:
1. Replace the check with an assertion.
--- drivers/dpll/dpll_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/dpll/dpll_core.c +4 -1
@@ -443,8 +443,11 @@ static void dpll_pin_prop_free(struct dpll_pin_properties *prop)static int dpll_pin_prop_dup (const struct dpll_pin_properties *src,struct dpll_pin_properties *dst) { +if (WARN_ON (src->freq_supported && !src->freq_supported_num)) +return -EINVAL ; +memcpy (dst, src,sizeof (*dst)); -if (src->freq_supported && src->freq_supported_num) { +if (src->freq_supported) {size_t freq_size = src->freq_supported_num *sizeof (*src->freq_supported); dst->freq_supported = kmemdup(src->freq_supported,
Signature · 1 line
2.25.1
kernel test robot
build botFYI: kernel test robot notices the stable kernel rule is not satisfied.
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
Rule: add the tag "Cc: [email protected]" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH v4 net-next] dpll: Add an assertion to check freq_supported_num
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 4 lines · Fri, Feb 28, 2025 at 04:02:10PM +0100, [email protected] wrote:
Since the driver is broken in the case that
src->freq_supportedis not NULL butsrc->freq_supported_numis 0, add an assertion for it.Signed-off-by Jiasheng Jiang <[email protected]>
Quoted 4 lines · Jiasheng Jiang
Since the driver is broken in the case that
src->freq_supportedis not NULL butsrc->freq_supported_numis 0, add an assertion for it.Signed-off-by Jiasheng Jiang <[email protected]>
Quoted 7 lines
From: Jiasheng Jiang <[email protected]>
Sent: Friday, February 28, 2025 4:02 PMSince the driver is broken in the case that
src->freq_supportedis not NULL butsrc->freq_supported_numis 0, add an assertion for it.Signed-off-by Jiasheng Jiang <[email protected]>
LGTM, thanks!
[..]
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Fri, 28 Feb 2025 15:02:10 +0000 you wrote:
Since the driver is broken in the case that
src->freq_supportedis not NULL butsrc->freq_supported_numis 0, add an assertion for it.Signed-off-by Jiasheng Jiang <[email protected]>---
Changelog:[...]
Here is the summary with links:
- [v4,net-next] dpll: Add an assertion to check freq_supported_num
https://git.kernel.org/netdev/net-next/c/39e912a959c1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html