virtio_remoteproc: correct put_device virtio_device.dev

rproc_virtio_dev_release will be called iff virtio_device.dev's
reference count drops to 0. Here we just put vdev.dev, and then
rproc->dev's cleanup will be done in rproc_virtio_dev_release.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
weiping zhang 2017-12-21 20:40:58 +08:00 committed by Bjorn Andersson
parent 4fbd8d194f
commit 900a163ede
1 changed files with 1 additions and 1 deletions

View File

@ -327,7 +327,7 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
ret = register_virtio_device(vdev);
if (ret) {
put_device(&rproc->dev);
put_device(&vdev->dev);
dev_err(dev, "failed to register vdev: %d\n", ret);
goto out;
}