All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove()
@ 2017-12-05 14:38 Dan Carpenter
  2017-12-05 16:23 ` Juergen Gross
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Dan Carpenter @ 2017-12-05 14:38 UTC (permalink / raw)
  To: kernel-janitors

bedata->ref can't be less than zero because it's unsigned.  This affects
certain error paths in probe.  We first set ->ref = -1 and then we set
it to a valid value later.

Fixes: 219681909913 ("xen/pvcalls: connect to the backend")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 40caa92bff33..d1e1d8d2b9d5 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -1103,7 +1103,7 @@ static int pvcalls_front_remove(struct xenbus_device *dev)
 			kfree(map);
 		}
 	}
-	if (bedata->ref >= 0)
+	if (bedata->ref != -1)
 		gnttab_end_foreign_access(bedata->ref, 0, 0);
 	kfree(bedata->ring.sring);
 	kfree(bedata);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove()
  2017-12-05 14:38 [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove() Dan Carpenter
@ 2017-12-05 16:23 ` Juergen Gross
  2017-12-05 16:23 ` Juergen Gross
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Juergen Gross @ 2017-12-05 16:23 UTC (permalink / raw)
  To: kernel-janitors

On 05/12/17 15:38, Dan Carpenter wrote:
> bedata->ref can't be less than zero because it's unsigned.  This affects
> certain error paths in probe.  We first set ->ref = -1 and then we set
> it to a valid value later.
> 
> Fixes: 219681909913 ("xen/pvcalls: connect to the backend")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove()
  2017-12-05 14:38 [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove() Dan Carpenter
  2017-12-05 16:23 ` Juergen Gross
@ 2017-12-05 16:23 ` Juergen Gross
  2017-12-05 18:29 ` Stefano Stabellini
  2017-12-05 18:29 ` [Xen-devel] " Stefano Stabellini
  3 siblings, 0 replies; 7+ messages in thread
From: Juergen Gross @ 2017-12-05 16:23 UTC (permalink / raw)
  To: Dan Carpenter, Boris Ostrovsky, Stefano Stabellini
  Cc: xen-devel, kernel-janitors

On 05/12/17 15:38, Dan Carpenter wrote:
> bedata->ref can't be less than zero because it's unsigned.  This affects
> certain error paths in probe.  We first set ->ref = -1 and then we set
> it to a valid value later.
> 
> Fixes: 219681909913 ("xen/pvcalls: connect to the backend")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove()
@ 2017-12-05 18:29 ` Stefano Stabellini
  2017-12-06 16:40   ` Boris Ostrovsky
  2017-12-06 16:40   ` Boris Ostrovsky
  0 siblings, 2 replies; 7+ messages in thread
From: Stefano Stabellini @ 2017-12-05 18:29 UTC (permalink / raw)
  To: kernel-janitors

On Tue, 5 Dec 2017, Dan Carpenter wrote:
> bedata->ref can't be less than zero because it's unsigned.  This affects
> certain error paths in probe.  We first set ->ref = -1 and then we set
> it to a valid value later.
> 
> Fixes: 219681909913 ("xen/pvcalls: connect to the backend")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
> index 40caa92bff33..d1e1d8d2b9d5 100644
> --- a/drivers/xen/pvcalls-front.c
> +++ b/drivers/xen/pvcalls-front.c
> @@ -1103,7 +1103,7 @@ static int pvcalls_front_remove(struct xenbus_device *dev)
>  			kfree(map);
>  		}
>  	}
> -	if (bedata->ref >= 0)
> +	if (bedata->ref != -1)
>  		gnttab_end_foreign_access(bedata->ref, 0, 0);
>  	kfree(bedata->ring.sring);
>  	kfree(bedata);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove()
  2017-12-05 14:38 [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove() Dan Carpenter
  2017-12-05 16:23 ` Juergen Gross
  2017-12-05 16:23 ` Juergen Gross
@ 2017-12-05 18:29 ` Stefano Stabellini
  2017-12-05 18:29 ` [Xen-devel] " Stefano Stabellini
  3 siblings, 0 replies; 7+ messages in thread
From: Stefano Stabellini @ 2017-12-05 18:29 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Juergen Gross, xen-devel, Boris Ostrovsky, Stefano Stabellini,
	kernel-janitors

On Tue, 5 Dec 2017, Dan Carpenter wrote:
> bedata->ref can't be less than zero because it's unsigned.  This affects
> certain error paths in probe.  We first set ->ref = -1 and then we set
> it to a valid value later.
> 
> Fixes: 219681909913 ("xen/pvcalls: connect to the backend")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
> index 40caa92bff33..d1e1d8d2b9d5 100644
> --- a/drivers/xen/pvcalls-front.c
> +++ b/drivers/xen/pvcalls-front.c
> @@ -1103,7 +1103,7 @@ static int pvcalls_front_remove(struct xenbus_device *dev)
>  			kfree(map);
>  		}
>  	}
> -	if (bedata->ref >= 0)
> +	if (bedata->ref != -1)
>  		gnttab_end_foreign_access(bedata->ref, 0, 0);
>  	kfree(bedata->ring.sring);
>  	kfree(bedata);
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove()
  2017-12-05 18:29 ` [Xen-devel] " Stefano Stabellini
@ 2017-12-06 16:40   ` Boris Ostrovsky
  2017-12-06 16:40   ` Boris Ostrovsky
  1 sibling, 0 replies; 7+ messages in thread
From: Boris Ostrovsky @ 2017-12-06 16:40 UTC (permalink / raw)
  To: kernel-janitors

On 12/05/2017 01:29 PM, Stefano Stabellini wrote:
> On Tue, 5 Dec 2017, Dan Carpenter wrote:
>> bedata->ref can't be less than zero because it's unsigned.  This affects
>> certain error paths in probe.  We first set ->ref = -1 and then we set
>> it to a valid value later.
>>
>> Fixes: 219681909913 ("xen/pvcalls: connect to the backend")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


Applied to for-linus-4.15.

-boris



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove()
  2017-12-05 18:29 ` [Xen-devel] " Stefano Stabellini
  2017-12-06 16:40   ` Boris Ostrovsky
@ 2017-12-06 16:40   ` Boris Ostrovsky
  1 sibling, 0 replies; 7+ messages in thread
From: Boris Ostrovsky @ 2017-12-06 16:40 UTC (permalink / raw)
  To: Stefano Stabellini, Dan Carpenter
  Cc: Juergen Gross, xen-devel, kernel-janitors

On 12/05/2017 01:29 PM, Stefano Stabellini wrote:
> On Tue, 5 Dec 2017, Dan Carpenter wrote:
>> bedata->ref can't be less than zero because it's unsigned.  This affects
>> certain error paths in probe.  We first set ->ref = -1 and then we set
>> it to a valid value later.
>>
>> Fixes: 219681909913 ("xen/pvcalls: connect to the backend")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


Applied to for-linus-4.15.

-boris



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-12-06 16:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-05 14:38 [PATCH 2/2] xen/pvcalls: Fix a check in pvcalls_front_remove() Dan Carpenter
2017-12-05 16:23 ` Juergen Gross
2017-12-05 16:23 ` Juergen Gross
2017-12-05 18:29 ` Stefano Stabellini
2017-12-05 18:29 ` [Xen-devel] " Stefano Stabellini
2017-12-06 16:40   ` Boris Ostrovsky
2017-12-06 16:40   ` Boris Ostrovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.