Re: [PATCH net-next v2 10/10] net: phy: Send notifier when starting the cable test
From: Andrew Lunn <andrew@lunn.ch>
Date: 2020-05-05 13:35:50
From: Andrew Lunn <andrew@lunn.ch>
Date: 2020-05-05 13:35:50
quoted
+static int ethnl_cable_test_started(struct phy_device *phydev) +{ + struct sk_buff *skb; + int err = -ENOMEM; + void *ehdr; + + skb = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); + if (!skb) + goto out; + + ehdr = ethnl_bcastmsg_put(skb, ETHTOOL_MSG_CABLE_TEST_NTF); + if (!ehdr) { + err = -EINVAL;This should rather be -EMSGSIZE. But as we are not going to use the return value anyway, it's only cosmetic problem.
Yes, cut/paste from the alloc function. I might put a phydev_err() in
out: so we get to know about errors.
Andrew