]> Git Repo - J-linux.git/commitdiff
vfio: platform: simplify device removal
authorUwe Kleine-König <[email protected]>
Tue, 26 Jan 2021 16:58:33 +0000 (17:58 +0100)
committerUwe Kleine-König <[email protected]>
Tue, 2 Feb 2021 13:24:23 +0000 (14:24 +0100)
vfio_platform_remove_common() cannot return non-NULL in
vfio_amba_remove() as the latter is only called if vfio_amba_probe()
returned success.

Diagnosed-by: Arnd Bergmann <[email protected]>
Acked-by: Eric Auger <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
drivers/vfio/platform/vfio_amba.c

index 9636a2afaecd1b4599473debb5ee7dc7908055b0..7b3ebf1558e1109c1b71e3f20d5435c1d0a72885 100644 (file)
@@ -73,16 +73,12 @@ static int vfio_amba_probe(struct amba_device *adev, const struct amba_id *id)
 
 static int vfio_amba_remove(struct amba_device *adev)
 {
-       struct vfio_platform_device *vdev;
-
-       vdev = vfio_platform_remove_common(&adev->dev);
-       if (vdev) {
-               kfree(vdev->name);
-               kfree(vdev);
-               return 0;
-       }
+       struct vfio_platform_device *vdev =
+               vfio_platform_remove_common(&adev->dev);
 
-       return -EINVAL;
+       kfree(vdev->name);
+       kfree(vdev);
+       return 0;
 }
 
 static const struct amba_id pl330_ids[] = {
This page took 0.048208 seconds and 4 git commands to generate.