WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [rfc][linux] xencomm encapsulates a NULL pointer

To: xen-ppc-devel <xen-ppc-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [XenPPC] [rfc][linux] xencomm encapsulates a NULL pointer
From: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Date: Wed, 12 Jul 2006 00:18:38 -0400
Delivery-date: Tue, 11 Jul 2006 21:19:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
sometimes the xencomm logic is passed a NULL pointer which is a valid value.
Since the check for NULL is done with:
  #define guest_handle_is_null(hnd)        ((hnd).p == NULL)

I figure we should still initialize but mark all array entires as invalid.
The follow patch should do the trick.
comments?
-JX

diff -r 72c8bc5d88f4 drivers/xen/core/xencomm.c
--- a/drivers/xen/core/xencomm.c        Thu Jun 29 13:04:30 2006 -0400
+++ b/drivers/xen/core/xencomm.c        Wed Jul 12 00:15:56 2006 -0400
@@ -60,7 +60,7 @@ static int __xencomm_init(struct xencomm
        int i = 0;
        /* record the physical pages used */
-       while ((recorded < bytes) && (i < desc->nr_addrs)) {
+       while (buffer && (recorded < bytes) && (i < desc->nr_addrs)) {
                unsigned long vaddr = (unsigned long)buffer + recorded;
                unsigned long paddr;
                int offset;


_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>