hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/virtio/virtio_mmio.c
....@@ -571,11 +571,9 @@
571571 {
572572 struct virtio_device *vdev =
573573 container_of(_d, struct virtio_device, dev);
574
- struct virtio_mmio_device *vm_dev =
575
- container_of(vdev, struct virtio_mmio_device, vdev);
576
- struct platform_device *pdev = vm_dev->pdev;
574
+ struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
577575
578
- devm_kfree(&pdev->dev, vm_dev);
576
+ kfree(vm_dev);
579577 }
580578
581579 /* Platform device */
....@@ -586,7 +584,7 @@
586584 unsigned long magic;
587585 int rc;
588586
589
- vm_dev = devm_kzalloc(&pdev->dev, sizeof(*vm_dev), GFP_KERNEL);
587
+ vm_dev = kzalloc(sizeof(*vm_dev), GFP_KERNEL);
590588 if (!vm_dev)
591589 return -ENOMEM;
592590