diff mbox series

Bluetooth: virtio_bt: fix an error code in probe()

Message ID 20211215114644.GC14552@kili
State New
Headers show
Series Bluetooth: virtio_bt: fix an error code in probe() | expand

Commit Message

Dan Carpenter Dec. 15, 2021, 11:46 a.m. UTC
Return an error code if virtbt_open_vdev() fails.  Don't return success.

Fixes: 212a6e51a630 ("Bluetooth: virtio_bt: fix device removal")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---

This almost certainly goes through Michael's virt tree and not the
Bluetooth tree.

 drivers/bluetooth/virtio_bt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael S. Tsirkin Dec. 20, 2021, 11:17 p.m. UTC | #1
On Wed, Dec 15, 2021 at 02:46:45PM +0300, Dan Carpenter wrote:
> Return an error code if virtbt_open_vdev() fails.  Don't return success.
> 
> Fixes: 212a6e51a630 ("Bluetooth: virtio_bt: fix device removal")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
> 
> This almost certainly goes through Michael's virt tree and not the
> Bluetooth tree.
> 
>  drivers/bluetooth/virtio_bt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c
> index 1dd734aef87b..f6d699fed139 100644
> --- a/drivers/bluetooth/virtio_bt.c
> +++ b/drivers/bluetooth/virtio_bt.c
> @@ -362,7 +362,8 @@ static int virtbt_probe(struct virtio_device *vdev)
>  	}
>  
>  	virtio_device_ready(vdev);
> -	if (virtbt_open_vdev(vbt))
> +	err = virtbt_open_vdev(vbt);
> +	if (err)
>  		goto open_failed;
>  
>  	return 0;
> -- 
> 2.20.1
diff mbox series

Patch

diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c
index 1dd734aef87b..f6d699fed139 100644
--- a/drivers/bluetooth/virtio_bt.c
+++ b/drivers/bluetooth/virtio_bt.c
@@ -362,7 +362,8 @@  static int virtbt_probe(struct virtio_device *vdev)
 	}
 
 	virtio_device_ready(vdev);
-	if (virtbt_open_vdev(vbt))
+	err = virtbt_open_vdev(vbt);
+	if (err)
 		goto open_failed;
 
 	return 0;