]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: dsa: fix wrong pointer passed to PTR_ERR() in dsa_port_phylink_create()
authorYang Yingliang <yangyingliang@huawei.com>
Sat, 8 Oct 2022 08:39:42 +0000 (16:39 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 9 Oct 2022 19:01:32 +0000 (20:01 +0100)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/port.c

index e4a0513816bb62034dec0924bca4171fceb3ae0a..208168276995aba29afab8c29312454598dc19b2 100644 (file)
@@ -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);
        }