The MCTP device isn't available until we've registered the netdev, so defer storing our convenience pointer.
Signed-off-by: Jeremy Kerr jk@codeconstruct.com.au --- net/mctp/test/utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/mctp/test/utils.c b/net/mctp/test/utils.c index e2ab1f3da357..cc6b8803aa9d 100644 --- a/net/mctp/test/utils.c +++ b/net/mctp/test/utils.c @@ -46,17 +46,17 @@ struct mctp_test_dev *mctp_test_create_dev(void) dev = netdev_priv(ndev); dev->ndev = ndev;
- rcu_read_lock(); - dev->mdev = __mctp_dev_get(ndev); - mctp_dev_hold(dev->mdev); - rcu_read_unlock(); - rc = register_netdev(ndev); if (rc) { free_netdev(ndev); return NULL; }
+ rcu_read_lock(); + dev->mdev = __mctp_dev_get(ndev); + mctp_dev_hold(dev->mdev); + rcu_read_unlock(); + return dev; }