aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/rapidio
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-10 17:37:25 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-10 17:37:25 +0100
commit993a47bd7b998156ffebc999617474c920dc9208 (patch)
treeffac31b8a168fa4ea6d180a2c3ed8054e0fd29a4 /drivers/rapidio
parentdriver core: faux: only create the device if probe() succeeds (diff)
parentLinux 6.14-rc6 (diff)
downloadwireguard-linux-993a47bd7b998156ffebc999617474c920dc9208.tar.xz
wireguard-linux-993a47bd7b998156ffebc999617474c920dc9208.zip
Merge 6.14-rc6 into driver-core-next
We need the driver core fix in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/rapidio')
-rw-r--r--drivers/rapidio/devices/rio_mport_cdev.c3
-rw-r--r--drivers/rapidio/rio-scan.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c
index 27afbb9d544b..cbf531d0ba68 100644
--- a/drivers/rapidio/devices/rio_mport_cdev.c
+++ b/drivers/rapidio/devices/rio_mport_cdev.c
@@ -1742,7 +1742,8 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,
err = rio_add_net(net);
if (err) {
rmcd_debug(RDEV, "failed to register net, err=%d", err);
- kfree(net);
+ put_device(&net->dev);
+ mport->net = NULL;
goto cleanup;
}
}
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index fdcf742b2adb..c12941f71e2c 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -871,7 +871,10 @@ static struct rio_net *rio_scan_alloc_net(struct rio_mport *mport,
dev_set_name(&net->dev, "rnet_%d", net->id);
net->dev.parent = &mport->dev;
net->dev.release = rio_scan_release_dev;
- rio_add_net(net);
+ if (rio_add_net(net)) {
+ put_device(&net->dev);
+ net = NULL;
+ }
}
return net;