netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dpll: fix return value check for kmemdup
@ 2024-05-13  3:28 Chen Ni
  2024-05-13  8:14 ` Przemek Kitszel
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chen Ni @ 2024-05-13  3:28 UTC (permalink / raw)
  To: vadim.fedorenko, arkadiusz.kubalewski, jiri, davem, jan.glaza,
	przemyslaw.kitszel
  Cc: netdev, linux-kernel, Chen Ni

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] dpll: fix return value check for kmemdup
  2024-05-13  3:28 [PATCH] dpll: fix return value check for kmemdup Chen Ni
@ 2024-05-13  8:14 ` Przemek Kitszel
  2024-05-13  8:16 ` Kubalewski, Arkadiusz
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Przemek Kitszel @ 2024-05-13  8:14 UTC (permalink / raw)
  To: Chen Ni, vadim.fedorenko, arkadiusz.kubalewski, jiri
  Cc: netdev, linux-kernel, davem, jan.glaza

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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] dpll: fix return value check for kmemdup
  2024-05-13  3:28 [PATCH] dpll: fix return value check for kmemdup Chen Ni
  2024-05-13  8:14 ` Przemek Kitszel
@ 2024-05-13  8:16 ` Kubalewski, Arkadiusz
  2024-05-13 10:51 ` Jiri Pirko
  2024-05-14  0:10 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Kubalewski, Arkadiusz @ 2024-05-13  8:16 UTC (permalink / raw)
  To: Chen Ni, vadim.fedorenko@linux.dev, jiri@resnulli.us,
	davem@davemloft.net, Glaza, Jan, Kitszel, Przemyslaw
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org

>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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dpll: fix return value check for kmemdup
  2024-05-13  3:28 [PATCH] dpll: fix return value check for kmemdup Chen Ni
  2024-05-13  8:14 ` Przemek Kitszel
  2024-05-13  8:16 ` Kubalewski, Arkadiusz
@ 2024-05-13 10:51 ` Jiri Pirko
  2024-05-14  0:10 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2024-05-13 10:51 UTC (permalink / raw)
  To: Chen Ni
  Cc: vadim.fedorenko, arkadiusz.kubalewski, davem, jan.glaza,
	przemyslaw.kitszel, netdev, linux-kernel

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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dpll: fix return value check for kmemdup
  2024-05-13  3:28 [PATCH] dpll: fix return value check for kmemdup Chen Ni
                   ` (2 preceding siblings ...)
  2024-05-13 10:51 ` Jiri Pirko
@ 2024-05-14  0:10 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-14  0:10 UTC (permalink / raw)
  To: Chen Ni
  Cc: vadim.fedorenko, arkadiusz.kubalewski, jiri, davem, jan.glaza,
	przemyslaw.kitszel, netdev, linux-kernel

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-14  0:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-13  3:28 [PATCH] dpll: fix return value check for kmemdup Chen Ni
2024-05-13  8:14 ` Przemek Kitszel
2024-05-13  8:16 ` Kubalewski, Arkadiusz
2024-05-13 10:51 ` Jiri Pirko
2024-05-14  0:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).