diff mbox series

[net] net: dsa: fix wrong pointer passed to PTR_ERR() in dsa_port_phylink_create()

Message ID 20221008083942.3244411-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit 557f050166e523ce86018d7a43e7d543d9598b3d
Delegated to: Netdev Maintainers
Headers show
Series [net] net: dsa: fix wrong pointer passed to PTR_ERR() in dsa_port_phylink_create() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 7 maintainers not CCed: vivien.didelot@gmail.com f.fainelli@gmail.com linux@armlinux.org.uk davem@davemloft.net andrew@lunn.ch edumazet@google.com pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
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: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yang Yingliang Oct. 8, 2022, 8:39 a.m. UTC
Fix wrong pointer passed to PTR_ERR() in dsa_port_phylink_create() to print
error message.

Fixes: cf5ca4ddc37a ("net: dsa: don't leave dangling pointers in dp->pl when failing")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 net/dsa/port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vladimir Oltean Oct. 8, 2022, 1:06 p.m. UTC | #1
On Sat, Oct 08, 2022 at 04:39:42PM +0800, Yang Yingliang wrote:
> Fix wrong pointer passed to PTR_ERR() in dsa_port_phylink_create() to print
> error message.
> 
> Fixes: cf5ca4ddc37a ("net: dsa: don't leave dangling pointers in dp->pl when failing")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Thanks!

>  net/dsa/port.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/dsa/port.c b/net/dsa/port.c
> index e4a0513816bb..208168276995 100644
> --- a/net/dsa/port.c
> +++ b/net/dsa/port.c
> @@ -1681,7 +1681,7 @@ int dsa_port_phylink_create(struct dsa_port *dp)
>  	pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
>  			    mode, &dsa_port_phylink_mac_ops);
>  	if (IS_ERR(pl)) {
> -		pr_err("error creating PHYLINK: %ld\n", PTR_ERR(dp->pl));
> +		pr_err("error creating PHYLINK: %ld\n", PTR_ERR(pl));
>  		return PTR_ERR(pl);
>  	}
>  
> -- 
> 2.25.1
>
patchwork-bot+netdevbpf@kernel.org Oct. 9, 2022, 7:10 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Sat, 8 Oct 2022 16:39:42 +0800 you wrote:
> Fix wrong pointer passed to PTR_ERR() in dsa_port_phylink_create() to print
> error message.
> 
> Fixes: cf5ca4ddc37a ("net: dsa: don't leave dangling pointers in dp->pl when failing")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  net/dsa/port.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net] net: dsa: fix wrong pointer passed to PTR_ERR() in dsa_port_phylink_create()
    https://git.kernel.org/netdev/net/c/557f050166e5

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/dsa/port.c b/net/dsa/port.c
index e4a0513816bb..208168276995 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -1681,7 +1681,7 @@  int dsa_port_phylink_create(struct dsa_port *dp)
 	pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
 			    mode, &dsa_port_phylink_mac_ops);
 	if (IS_ERR(pl)) {
-		pr_err("error creating PHYLINK: %ld\n", PTR_ERR(dp->pl));
+		pr_err("error creating PHYLINK: %ld\n", PTR_ERR(pl));
 		return PTR_ERR(pl);
 	}