public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix vq_memory_access_ok error checking
@ 2010-04-06 20:14 Jeff Dike
  2010-04-07  7:49 ` Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Dike @ 2010-04-06 20:14 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Xin, Xiaohui, linux-kernel

Here's another small patch fixing an error path...

			Jeff

-- 
Work email - jdike at linux dot intel dot com


commit 7938779d9f357ede8bc3c122fd0dc9d5ec4fcf1d
Author: Jeff Dike <jdike@addtoit.com>
Date:   Wed Mar 31 15:05:08 2010 -0400

    vq_memory_access_ok needs to check whether mem == NULL

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 7bd7a1e..b8e1127 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -235,6 +235,10 @@ static int vq_memory_access_ok(void __user *log_base, struct vhost_memory *mem,
 			       int log_all)
 {
 	int i;
+
+        if (!mem)
+                return 0;
+
 	for (i = 0; i < mem->nregions; ++i) {
 		struct vhost_memory_region *m = mem->regions + i;
 		unsigned long a = m->userspace_addr;

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

* Re: [PATCH] Fix vq_memory_access_ok error checking
  2010-04-06 20:14 [PATCH] Fix vq_memory_access_ok error checking Jeff Dike
@ 2010-04-07  7:49 ` Michael S. Tsirkin
  2010-04-07 13:59   ` Jeff Dike
  0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2010-04-07  7:49 UTC (permalink / raw)
  To: Jeff Dike; +Cc: Xin, Xiaohui, linux-kernel

On Tue, Apr 06, 2010 at 04:14:14PM -0400, Jeff Dike wrote:
> Here's another small patch fixing an error path...
> 
> 			Jeff
> 
> -- 
> Work email - jdike at linux dot intel dot com
> 
> 
> commit 7938779d9f357ede8bc3c122fd0dc9d5ec4fcf1d
> Author: Jeff Dike <jdike@addtoit.com>
> Date:   Wed Mar 31 15:05:08 2010 -0400
> 
>     vq_memory_access_ok needs to check whether mem == NULL

Thanks!
Can you add a Signed-off-by line?

The sign-off is a simple line at the end of the explanation for the
patch, which certifies that you wrote it or otherwise have the right to
pass it on as a open-source patch.  The rules are pretty simple: if you
can certify the below:

        Developer's Certificate of Origin 1.1

        By making a contribution to this project, I certify that:

        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or

        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or

        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.

	(d) I understand and agree that this project and the contribution
	    are public and that a record of the contribution (including all
	    personal information I submit with it, including my sign-off) is
	    maintained indefinitely and may be redistributed consistent with
	    this project or the open source license(s) involved.

then you just add a line saying

	Signed-off-by: Random J Developer <random@developer.example.org>

> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index 7bd7a1e..b8e1127 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -235,6 +235,10 @@ static int vq_memory_access_ok(void __user *log_base, struct vhost_memory *mem,
>  			       int log_all)
>  {
>  	int i;
> +
> +        if (!mem)
> +                return 0;
> +
>  	for (i = 0; i < mem->nregions; ++i) {
>  		struct vhost_memory_region *m = mem->regions + i;
>  		unsigned long a = m->userspace_addr;

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

* Re: [PATCH] Fix vq_memory_access_ok error checking
  2010-04-07  7:49 ` Michael S. Tsirkin
@ 2010-04-07 13:59   ` Jeff Dike
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Dike @ 2010-04-07 13:59 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Xin, Xiaohui, linux-kernel

On Wed, Apr 07, 2010 at 10:49:07AM +0300, Michael S. Tsirkin wrote:
> Thanks!
> Can you add a Signed-off-by line?

Oops, I was in a hurry...

commit 7938779d9f357ede8bc3c122fd0dc9d5ec4fcf1d
Author: Jeff Dike <jdike@addtoit.com>
Date:   Wed Mar 31 15:05:08 2010 -0400

    vq_memory_access_ok needs to check whether mem == NULL

    Signed-off-by: Jeff Dike <jdike@linux.intel.com>

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 7bd7a1e..b8e1127 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -235,6 +235,10 @@ static int vq_memory_access_ok(void __user *log_base, struct vhost_memory *mem,
 			       int log_all)
 {
 	int i;
+
+        if (!mem)
+                return 0;
+
 	for (i = 0; i < mem->nregions; ++i) {
 		struct vhost_memory_region *m = mem->regions + i;
 		unsigned long a = m->userspace_addr;

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

end of thread, other threads:[~2010-04-07 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-06 20:14 [PATCH] Fix vq_memory_access_ok error checking Jeff Dike
2010-04-07  7:49 ` Michael S. Tsirkin
2010-04-07 13:59   ` Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox