Message ID | 20210107221521.11bdf4917387.I2851b5ff7f03e79264fe6cca65465247df9d9d98@changeid |
---|---|
State | Accepted |
Headers | show |
Series | um: virtio: free vu_dev only with the contained struct device | expand |
diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c index c870d42d7268..91ddf74ca888 100644 --- a/arch/um/drivers/virtio_uml.c +++ b/arch/um/drivers/virtio_uml.c @@ -1095,6 +1095,7 @@ static void virtio_uml_release_dev(struct device *d) } os_close_file(vu_dev->sock); + kfree(vu_dev); } /* Platform device */ @@ -1108,7 +1109,7 @@ static int virtio_uml_probe(struct platform_device *pdev) if (!pdata) return -EINVAL; - vu_dev = devm_kzalloc(&pdev->dev, sizeof(*vu_dev), GFP_KERNEL); + vu_dev = kzalloc(sizeof(*vu_dev), GFP_KERNEL); if (!vu_dev) return -ENOMEM;