[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XenPPC] [rfc][linux] xencomm encapsulates a NULL pointer
On Wed, 2006-07-12 at 00:18 -0400, Jimi Xenidis wrote: > 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; Shouldn't 'bytes' be 0 in the case of a NULL pointer? In that case, I think this code should already work? -- Hollis Blanchard IBM Linux Technology Center _______________________________________________ Xen-ppc-devel mailing list Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-ppc-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |