From mboxrd@z Thu Jan 1 00:00:00 1970 From: weiping zhang Subject: [PATCH v3 0/5] proper cleanup if fail to register_virtio_device Date: Sun, 17 Dec 2017 21:45:21 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: cohuck@redhat.com, mst@redhat.com, jasowang@redhat.com Cc: virtualization@lists.linux-foundation.org List-Id: virtualization@lists.linuxfoundation.org Hi, Patch1 add a helper to get virtio_device's status which will be used later. Patch2~4: check virtio_device's status is RTIO_CONFIG_S_ACKNOWLEDGE or not, if so use put_device otherwise use kfree. Patch5: add comments for virtio_register_device help caller do a proper cleanup if got failure. weiping zhang (5): virtio: add helper virtio_get_status 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 virtio: add comments for virtio_register_device drivers/misc/mic/vop/vop_main.c | 17 +++++++++++------ drivers/remoteproc/remoteproc_virtio.c | 10 +++++++++- drivers/virtio/virtio.c | 19 +++++++++++++++++++ drivers/virtio/virtio_pci_common.c | 5 ++++- include/linux/virtio_config.h | 2 ++ 5 files changed, 45 insertions(+), 8 deletions(-) -- 2.9.4