On Tue, Apr 27, 2021 at 02:32:27PM +0200, Cornelia Huck wrote: > > + device_unlock(&mdev->dev); > > + ret = device_attach(&mdev->dev); > > + if (ret) > > + return ret; > > device_attach() can return 0 (no driver), 1 (bound), or -ENODEV (device > not registered). I would expect mdev_bind_driver() to return 0 in case > of success and !0 otherwise, and I think the calling code does so as > well? Oops yes it can, I changed it to this, thanks! @@ -269,7 +269,7 @@ static int mdev_bind_driver(struct mdev_device *mdev) } device_unlock(&mdev->dev); ret = device_attach(&mdev->dev); - if (ret) + if (ret < 0) return ret; mdev->probe_err = -EINVAL; } Jason