Commit 5b495ac8 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Uwe Kleine-König

vfio: platform: simplify device removal

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: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarEric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20210126165835.687514-4-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 5150a8f0
......@@ -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[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment