diff mbox series

dpll: fix return value check for kmemdup

Message ID 20240513032824.2410459-1-nichen@iscas.ac.cn (mailing list archive)
State Accepted
Commit ad506586cb69292b6ac59ab95468aadd54b19ab7
Delegated to: Netdev Maintainers
Headers show
Series dpll: fix return value check for kmemdup | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 927 this patch: 927
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 936 this patch: 936
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 938 this patch: 938
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-14--00-00 (tests: 1022)

Commit Message

Chen Ni May 13, 2024, 3:28 a.m. UTC
The return value of kmemdup() is dst->freq_supported, not
src->freq_supported. Update the check accordingly.

Fixes: 830ead5fb0c5 ("dpll: fix pin dump crash for rebound module")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/dpll/dpll_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Przemek Kitszel May 13, 2024, 8:14 a.m. UTC | #1
On 5/13/24 05:28, Chen Ni wrote:
> The return value of kmemdup() is dst->freq_supported, not
> src->freq_supported. Update the check accordingly.
> 
> Fixes: 830ead5fb0c5 ("dpll: fix pin dump crash for rebound module")
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> ---
>   drivers/dpll/dpll_core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
> index d0f6693ca142..32019dc33cca 100644
> --- a/drivers/dpll/dpll_core.c
> +++ b/drivers/dpll/dpll_core.c
> @@ -449,7 +449,7 @@ static int dpll_pin_prop_dup(const struct dpll_pin_properties *src,
>   				   sizeof(*src->freq_supported);
>   		dst->freq_supported = kmemdup(src->freq_supported,
>   					      freq_size, GFP_KERNEL);
> -		if (!src->freq_supported)
> +		if (!dst->freq_supported)
>   			return -ENOMEM;
>   	}
>   	if (src->board_label) {

Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Kubalewski, Arkadiusz May 13, 2024, 8:16 a.m. UTC | #2
>From: Chen Ni <nichen@iscas.ac.cn>
>Sent: Monday, May 13, 2024 5:28 AM
>
>The return value of kmemdup() is dst->freq_supported, not
>src->freq_supported. Update the check accordingly.
>
>Fixes: 830ead5fb0c5 ("dpll: fix pin dump crash for rebound module")
>Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
>---
> drivers/dpll/dpll_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
>index d0f6693ca142..32019dc33cca 100644
>--- a/drivers/dpll/dpll_core.c
>+++ b/drivers/dpll/dpll_core.c
>@@ -449,7 +449,7 @@ static int dpll_pin_prop_dup(const struct
>dpll_pin_properties *src,
> 				   sizeof(*src->freq_supported);
> 		dst->freq_supported = kmemdup(src->freq_supported,
> 					      freq_size, GFP_KERNEL);
>-		if (!src->freq_supported)
>+		if (!dst->freq_supported)
> 			return -ENOMEM;
> 	}
> 	if (src->board_label) {
>--
>2.25.1

LGTM, Thanks!

Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Jiri Pirko May 13, 2024, 10:51 a.m. UTC | #3
Mon, May 13, 2024 at 05:28:24AM CEST, nichen@iscas.ac.cn wrote:
>The return value of kmemdup() is dst->freq_supported, not
>src->freq_supported. Update the check accordingly.
>
>Fixes: 830ead5fb0c5 ("dpll: fix pin dump crash for rebound module")
>Signed-off-by: Chen Ni <nichen@iscas.ac.cn>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
patchwork-bot+netdevbpf@kernel.org May 14, 2024, 12:10 a.m. UTC | #4
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 13 May 2024 11:28:24 +0800 you wrote:
> The return value of kmemdup() is dst->freq_supported, not
> src->freq_supported. Update the check accordingly.
> 
> Fixes: 830ead5fb0c5 ("dpll: fix pin dump crash for rebound module")
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> ---
>  drivers/dpll/dpll_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - dpll: fix return value check for kmemdup
    https://git.kernel.org/netdev/net/c/ad506586cb69

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
index d0f6693ca142..32019dc33cca 100644
--- a/drivers/dpll/dpll_core.c
+++ b/drivers/dpll/dpll_core.c
@@ -449,7 +449,7 @@  static int dpll_pin_prop_dup(const struct dpll_pin_properties *src,
 				   sizeof(*src->freq_supported);
 		dst->freq_supported = kmemdup(src->freq_supported,
 					      freq_size, GFP_KERNEL);
-		if (!src->freq_supported)
+		if (!dst->freq_supported)
 			return -ENOMEM;
 	}
 	if (src->board_label) {