summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-04-27 21:41:52 +0300
committerToomas Soome <tsoome@me.com>2019-05-06 18:53:18 +0300
commitec94a9ff4ab0283a0221a1c4e0257d20427d5960 (patch)
tree65122543de8a5bba08119431cab48fe00747159b
parent5d420dfb9577a4f834e8d2d5dfad9208567450d3 (diff)
downloadillumos-joyent-ec94a9ff4ab0283a0221a1c4e0257d20427d5960.tar.gz
10872 sd: NULL pointer errors
Reviewed by: John Levon <john.levon@joyent.com> Reviewed by: Gergő Doma <domag02@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/uts/common/io/scsi/targets/sd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr/src/uts/common/io/scsi/targets/sd.c b/usr/src/uts/common/io/scsi/targets/sd.c
index ffb0987dd5..f968b54847 100644
--- a/usr/src/uts/common/io/scsi/targets/sd.c
+++ b/usr/src/uts/common/io/scsi/targets/sd.c
@@ -30549,7 +30549,7 @@ sd_faultinjection_ioctl(int cmd, intptr_t arg, struct sd_lun *un)
kmem_free(un->sd_fi_fifo_pkt[i],
sizeof (struct sd_fi_pkt));
}
- if (arg != NULL) {
+ if (arg != (uintptr_t)NULL) {
un->sd_fi_fifo_pkt[i] =
kmem_alloc(sizeof (struct sd_fi_pkt), KM_NOSLEEP);
if (un->sd_fi_fifo_pkt[i] == NULL) {
@@ -30583,7 +30583,7 @@ sd_faultinjection_ioctl(int cmd, intptr_t arg, struct sd_lun *un)
sizeof (struct sd_fi_xb));
un->sd_fi_fifo_xb[i] = NULL;
}
- if (arg != NULL) {
+ if (arg != (uintptr_t)NULL) {
un->sd_fi_fifo_xb[i] =
kmem_alloc(sizeof (struct sd_fi_xb), KM_NOSLEEP);
if (un->sd_fi_fifo_xb[i] == NULL) {
@@ -30618,7 +30618,7 @@ sd_faultinjection_ioctl(int cmd, intptr_t arg, struct sd_lun *un)
sizeof (struct sd_fi_un));
un->sd_fi_fifo_un[i] = NULL;
}
- if (arg != NULL) {
+ if (arg != (uintptr_t)NULL) {
un->sd_fi_fifo_un[i] =
kmem_alloc(sizeof (struct sd_fi_un), KM_NOSLEEP);
if (un->sd_fi_fifo_un[i] == NULL) {
@@ -30653,7 +30653,7 @@ sd_faultinjection_ioctl(int cmd, intptr_t arg, struct sd_lun *un)
sizeof (struct sd_fi_arq));
un->sd_fi_fifo_arq[i] = NULL;
}
- if (arg != NULL) {
+ if (arg != (uintptr_t)NULL) {
un->sd_fi_fifo_arq[i] =
kmem_alloc(sizeof (struct sd_fi_arq), KM_NOSLEEP);
if (un->sd_fi_fifo_arq[i] == NULL) {
@@ -30679,7 +30679,7 @@ sd_faultinjection_ioctl(int cmd, intptr_t arg, struct sd_lun *un)
/* Push stored xb, pkt, un, and arq onto fifo */
sd_fault_injection_on = 0;
- if (arg != NULL) {
+ if (arg != (uintptr_t)NULL) {
rval = ddi_copyin((void *)arg, &i, sizeof (uint_t), 0);
if (rval != -1 &&
un->sd_fi_fifo_end + i < SD_FI_MAX_ERROR) {
@@ -30714,7 +30714,7 @@ sd_faultinjection_ioctl(int cmd, intptr_t arg, struct sd_lun *un)
* arg is possibly invalid setting
* it to NULL for return
*/
- arg = NULL;
+ arg = (uintptr_t)NULL;
}
break;
}