summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-20 22:43:13 +0200
committerToomas Soome <tsoome@me.com>2019-04-22 08:40:26 +0300
commit2952f70a6a70b04a459a24166d796cdf2f629ed8 (patch)
treebd78dd1cc8a976234dcd9c9687fa62fe9c03dc86
parenta2d4e26a43f10718fe33e47fa968a3fdf901e156 (diff)
downloadillumos-joyent-2952f70a6a70b04a459a24166d796cdf2f629ed8.tar.gz
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>
-rw-r--r--usr/src/uts/common/xen/io/xdb.c8
-rw-r--r--usr/src/uts/common/xen/os/xvdi.c4
-rw-r--r--usr/src/uts/i86pc/os/fakebop.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/usr/src/uts/common/xen/io/xdb.c b/usr/src/uts/common/xen/io/xdb.c
index a739f5b701..bcd3ac92fb 100644
--- a/usr/src/uts/common/xen/io/xdb.c
+++ b/usr/src/uts/common/xen/io/xdb.c
@@ -372,7 +372,7 @@ xdb_get_buf(xdb_t *vdp, blkif_request_t *req, xdb_request_t *xreq)
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 @@ xdb_biodone(buf_t *bp)
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 @@ xdb_biodone(buf_t *bp)
* 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 @@ xdb_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
/* 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);
diff --git a/usr/src/uts/common/xen/os/xvdi.c b/usr/src/uts/common/xen/os/xvdi.c
index d9013868be..e708dfbf13 100644
--- a/usr/src/uts/common/xen/os/xvdi.c
+++ b/usr/src/uts/common/xen/os/xvdi.c
@@ -589,7 +589,7 @@ errout2:
/* 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 @@ xvdi_unmap_ring(xendev_ring_t *ring)
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);
diff --git a/usr/src/uts/i86pc/os/fakebop.c b/usr/src/uts/i86pc/os/fakebop.c
index 8ba2e74681..85ad7bd9b9 100644
--- a/usr/src/uts/i86pc/os/fakebop.c
+++ b/usr/src/uts/i86pc/os/fakebop.c
@@ -993,11 +993,11 @@ xen_parse_props(char *s, char *prop_map[], int n_prop)
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);
}