]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_vop: don't kfree device on register failure
authorweiping zhang <zhangweiping@didichuxing.com>
Thu, 21 Dec 2017 12:40:43 +0000 (20:40 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 1 Feb 2018 14:26:45 +0000 (16:26 +0200)
commit43b3271a6bded358e7df6c492ea4765adf67c73f
treef913958c384c5faaf936626b6764c7e68a971122
parentf6b898c9c4f0dd99a30994c6487e9b44508e8165
virtio_vop: don't kfree device on register failure

As mentioned at drivers/base/core.c:
/*
 * NOTE: _Never_ directly free @dev after calling this function, even
 * if it returned an error! Always use put_device() to give up the
 * reference initialized in this function instead.
 */
so we don't free vdev until vdev->vdev.dev.release be called.

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/misc/mic/vop/vop_main.c