]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/vfio/vfio.c
Merge remote-tracking branches 'asoc/fix/fsl-dma', 'asoc/fix/fsl-spdif', 'asoc/fix...
[karo-tx-linux.git] / drivers / vfio / vfio.c
index 512f479d8a50af5eb95c2717bb9a225b9a4e6bfa..f018d8d0f975360a091339699d12348c5c93a12b 100644 (file)
@@ -349,7 +349,6 @@ struct vfio_device *vfio_group_create_device(struct vfio_group *group,
                                             void *device_data)
 {
        struct vfio_device *device;
-       int ret;
 
        device = kzalloc(sizeof(*device), GFP_KERNEL);
        if (!device)
@@ -360,12 +359,7 @@ struct vfio_device *vfio_group_create_device(struct vfio_group *group,
        device->group = group;
        device->ops = ops;
        device->device_data = device_data;
-
-       ret = dev_set_drvdata(dev, device);
-       if (ret) {
-               kfree(device);
-               return ERR_PTR(ret);
-       }
+       dev_set_drvdata(dev, device);
 
        /* No need to get group_lock, caller has group reference */
        vfio_group_get(group);