Skip to content

use put_device to cleanup resource

weiping zhang virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest4 patches 7 repliesIn review

Changes in v4 from the cover letter

* split device_register into device_initialize and devicea_add that the caller can always use put_device when fail to register virtio device.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4virtio: split device_register into device_initialize and device_adddrivers/virtio/virtio.c+15 -33 replies
2/4virtio_pci: don't kfree device on register failuredrivers/virtio/virtio_pci_common.c+6 -21 reply
3/4virtio_vop: don't kfree device on register failuredrivers/misc/mic/vop/vop_main.c+13 -71 reply
4/4virtio_remoteproc: don't kfree device on register failuredrivers/remoteproc/remoteproc_virtio.c+11 -22 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchCornelia Huck
1/4
2/4R-b
3/4R-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/4] use put_device to cleanup resource

Hi,

The main change is split device_register into 2 sperate calls:
device_initalize() and device_add, and then the caller can use put_device safety when fail to register_virtio_device.

v3->v4:
* split device_register into device_initialize and devicea_add that the caller can always use put_device when fail to register virtio device.

v2->v3:
* virtio: add new helper do get device's status then determine use put_device or kfree.

v1->v2:
* virtio_pci: add comments in commit message for why using put_device
* virtio_vop: also use put_device int _vop_remove_device
weiping zhang (4):
virtio: split device_register into device_initialize and device_add
virtio_pci: don't kfree device on register failure
virtio_vop: don't kfree device on register failure
virtio_remoteproc: don't kfree device on register failure

 drivers/misc/mic/vop/vop_main.c        | 20 +++++++++++++-------
 drivers/remoteproc/remoteproc_virtio.c | 13 +++++++++++--
 drivers/virtio/virtio.c                | 18 +++++++++++++++---
 drivers/virtio/virtio_pci_common.c     |  8 ++++++--
 4 files changed, 45 insertions(+), 14 deletions(-)
Signature · 1 line
2.9.4