changeset 21134:c836c3e01743

10799 i86xpv: NULL pointer errors Reviewed by: John Levon <john.levon@joyent.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Toomas Soome <tsoome@me.com>
date Sun, 20 Jan 2019 22:43:13 +0200
parents f81937bacf37
children 790377e6233c
files usr/src/uts/common/xen/io/xdb.c usr/src/uts/common/xen/os/xvdi.c usr/src/uts/i86pc/os/fakebop.c
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/xen/io/xdb.c	Sun Jan 20 22:40:57 2019 +0200
+++ b/usr/src/uts/common/xen/io/xdb.c	Sun Jan 20 22:43:13 2019 +0200
@@ -372,7 +372,7 @@
 				unmapop.host_addr =
 				    (uint64_t)(uintptr_t)XDB_IOPAGE_VA(
 				    vdp->xs_iopage_va, xreq->xr_idx, i);
-				unmapop.dev_bus_addr = NULL;
+				unmapop.dev_bus_addr = 0;
 				unmapop.handle = mapops[i].handle;
 				(void) HYPERVISOR_grant_table_op(
 				    GNTTABOP_unmap_grant_ref, &unmapop, 1);
@@ -676,7 +676,7 @@
 		unlogva(vdp, unmapops[i].host_addr);
 		mutex_exit(&vdp->xs_iomutex);
 #endif
-		unmapops[i].dev_bus_addr = NULL;
+		unmapops[i].dev_bus_addr = 0;
 		unmapops[i].handle = xreq->xr_page_hdls[i];
 	}
 	err = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref,
@@ -697,7 +697,7 @@
 		 * For now, just cast to void.
 		 */
 		(void) ldi_ioctl(vdp->xs_ldi_hdl,
-		    DKIOCFLUSHWRITECACHE, NULL, FKIOCTL, kcred, NULL);
+		    DKIOCFLUSHWRITECACHE, 0, FKIOCTL, kcred, NULL);
 	}
 
 	mutex_enter(&vdp->xs_iomutex);
@@ -1692,7 +1692,7 @@
 	/* Check if the frontend device is supposed to be read only */
 	if (xenbus_read_str(xsname, "mode", &str) != 0)
 		return (DDI_FAILURE);
-	if ((strcmp(str, "r") == NULL) || (strcmp(str, "ro") == NULL))
+	if ((strcmp(str, "r") == 0) || (strcmp(str, "ro") == 0))
 		vdp->xs_type |= XDB_DEV_RO;
 	strfree(str);
 
--- a/usr/src/uts/common/xen/os/xvdi.c	Sun Jan 20 22:40:57 2019 +0200
+++ b/usr/src/uts/common/xen/os/xvdi.c	Sun Jan 20 22:43:13 2019 +0200
@@ -589,7 +589,7 @@
 	/* unmap ring page */
 	unmapop.host_addr = (uint64_t)(uintptr_t)ringva;
 	unmapop.handle = ring->xr_grant_hdl;
-	unmapop.dev_bus_addr = NULL;
+	unmapop.dev_bus_addr = 0;
 	(void) HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &unmapop, 1);
 	hat_release_mapping(kas.a_hat, ringva);
 errout1:
@@ -612,7 +612,7 @@
 	impl_acc_hdl_free(ring->xr_acc_hdl);
 	unmapop.host_addr = (uint64_t)(uintptr_t)ring->xr_vaddr;
 	unmapop.handle = ring->xr_grant_hdl;
-	unmapop.dev_bus_addr = NULL;
+	unmapop.dev_bus_addr = 0;
 	(void) HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &unmapop, 1);
 	hat_release_mapping(kas.a_hat, ring->xr_vaddr);
 	vmem_xfree(heap_arena, ring->xr_vaddr, PAGESIZE);
--- a/usr/src/uts/i86pc/os/fakebop.c	Sun Jan 20 22:40:57 2019 +0200
+++ b/usr/src/uts/i86pc/os/fakebop.c	Sun Jan 20 22:43:13 2019 +0200
@@ -993,11 +993,11 @@
 
 	do {
 		scp = cp;
-		while ((*cp != NULL) && (*cp != ':'))
+		while ((*cp != '\0') && (*cp != ':'))
 			cp++;
 
 		if ((scp != cp) && (*prop_name != NULL)) {
-			*cp = NULL;
+			*cp = '\0';
 			bsetprops(*prop_name, scp);
 		}