diff mbox series

xen/netback: fix error path of xenvif_connect_data()

Message ID 20191018074549.4778-1-jgross@suse.com (mailing list archive)
State Accepted
Commit 3d5c1a037d37392a6859afbde49be5ba6a70a6b3
Headers show
Series xen/netback: fix error path of xenvif_connect_data() | expand

Commit Message

Jürgen Groß Oct. 18, 2019, 7:45 a.m. UTC
xenvif_connect_data() calls module_put() in case of error. This is
wrong as there is no related module_get().

Remove the superfluous module_put().

Fixes: 279f438e36c0a7 ("xen-netback: Don't destroy the netdev until the vif is shut down")
Cc: <stable@vger.kernel.org> # 3.12
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 drivers/net/xen-netback/interface.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Wei Liu Oct. 18, 2019, 9:10 a.m. UTC | #1
On Fri, Oct 18, 2019 at 09:45:49AM +0200, Juergen Gross wrote:
> xenvif_connect_data() calls module_put() in case of error. This is
> wrong as there is no related module_get().
> 
> Remove the superfluous module_put().
> 
> Fixes: 279f438e36c0a7 ("xen-netback: Don't destroy the netdev until the vif is shut down")
> Cc: <stable@vger.kernel.org> # 3.12
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Reviewed-by: Paul Durrant <paul@xen.org>

Reviewed-by: Wei Liu <wei.liu@kernel.org>

> ---
>  drivers/net/xen-netback/interface.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
> index 240f762b3749..103ed00775eb 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -719,7 +719,6 @@ int xenvif_connect_data(struct xenvif_queue *queue,
>  	xenvif_unmap_frontend_data_rings(queue);
>  	netif_napi_del(&queue->napi);
>  err:
> -	module_put(THIS_MODULE);
>  	return err;
>  }
>  
> -- 
> 2.16.4
>
David Miller Oct. 19, 2019, 6:51 p.m. UTC | #2
From: Juergen Gross <jgross@suse.com>
Date: Fri, 18 Oct 2019 09:45:49 +0200

> xenvif_connect_data() calls module_put() in case of error. This is
> wrong as there is no related module_get().
> 
> Remove the superfluous module_put().
> 
> Fixes: 279f438e36c0a7 ("xen-netback: Don't destroy the netdev until the vif is shut down")
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Reviewed-by: Paul Durrant <paul@xen.org>

Applied and queued up for -stable.
diff mbox series

Patch

diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 240f762b3749..103ed00775eb 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -719,7 +719,6 @@  int xenvif_connect_data(struct xenvif_queue *queue,
 	xenvif_unmap_frontend_data_rings(queue);
 	netif_napi_del(&queue->napi);
 err:
-	module_put(THIS_MODULE);
 	return err;
 }