summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-02-14 17:26:57 +0200
committerToomas Soome <tsoome@me.com>2019-02-21 00:38:14 +0200
commita8b4e7c71a6c1ef07e77c48dbb92fcdc8624266d (patch)
tree4515e2c1a0ac9a444f651811a8d6ab4d5898e6d3
parentf1ccfd86d00d3a46fa8dc85b88860e10a3ad1019 (diff)
downloadillumos-joyent-a8b4e7c71a6c1ef07e77c48dbb92fcdc8624266d.tar.gz
10424 uts: NULL pointer errors in DEBUG build
Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Gergő Doma <domag02@gmail.com> Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/uts/common/os/bio.c16
-rw-r--r--usr/src/uts/common/os/taskq.c4
2 files changed, 10 insertions, 10 deletions
diff --git a/usr/src/uts/common/os/bio.c b/usr/src/uts/common/os/bio.c
index 81d26a4777..b5b2bee298 100644
--- a/usr/src/uts/common/os/bio.c
+++ b/usr/src/uts/common/os/bio.c
@@ -29,7 +29,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -76,7 +76,7 @@ static kmutex_t bfree_lock; /* protects the bfreelist structure */
struct hbuf *hbuf; /* Hash buckets */
struct dwbuf *dwbuf; /* Delayed write buckets */
static struct buf *bhdrlist; /* buf header free list */
-static int nbuf; /* number of buffer headers allocated */
+static int nbuf; /* number of buffer headers allocated */
static int lastindex; /* Reference point on where to start */
/* when looking for free buffers */
@@ -84,7 +84,7 @@ static int lastindex; /* Reference point on where to start */
#define bio_bhash(dev, bn) (hash2ints((dev), (int)(bn)) & v.v_hmask)
#define EMPTY_LIST ((struct buf *)-1)
-static kcondvar_t bio_mem_cv; /* Condition variables */
+static kcondvar_t bio_mem_cv; /* Condition variables */
static kcondvar_t bio_flushinval_cv;
static int bio_doingflush; /* flush in progress */
static int bio_doinginval; /* inval in progress */
@@ -139,12 +139,12 @@ void (*bio_snapshot_strategy)(void *, buf_t *);
/* Private routines */
static struct buf *bio_getfreeblk(long);
-static void bio_mem_get(long);
+static void bio_mem_get(long);
static void bio_bhdr_free(struct buf *);
static struct buf *bio_bhdr_alloc(void);
static void bio_recycle(int, long);
-static void bio_pageio_done(struct buf *);
-static int bio_incore(dev_t, daddr_t);
+static void bio_pageio_done(struct buf *);
+static int bio_incore(dev_t, daddr_t);
/*
* Buffer cache constants
@@ -642,7 +642,7 @@ loop:
notavail(bp);
mutex_exit(hmp);
- ASSERT((bp->b_flags & B_NOCACHE) == NULL);
+ ASSERT((bp->b_flags & B_NOCACHE) == 0);
if (nbp == NULL) {
/*
@@ -716,7 +716,7 @@ loop:
nbp->b_vp = NULL;
}
- ASSERT((nbp->b_flags & B_NOCACHE) == NULL);
+ ASSERT((nbp->b_flags & B_NOCACHE) == 0);
binshash(nbp, dp);
mutex_exit(hmp);
diff --git a/usr/src/uts/common/os/taskq.c b/usr/src/uts/common/os/taskq.c
index 5714831e96..9a7697d16a 100644
--- a/usr/src/uts/common/os/taskq.c
+++ b/usr/src/uts/common/os/taskq.c
@@ -700,7 +700,7 @@ uint_t taskq_smtbf = UINT_MAX; /* mean time between injected failures */
taskq_random = (taskq_random * 2416 + 374441) % 1771875;\
if ((flag & TQ_NOSLEEP) && \
taskq_random < 1771875 / taskq_dmtbf) { \
- return (NULL); \
+ return ((taskqid_t)NULL); \
}
#define TASKQ_S_RANDOM_DISPATCH_FAILURE(tq, flag) \
@@ -710,7 +710,7 @@ uint_t taskq_smtbf = UINT_MAX; /* mean time between injected failures */
(tq->tq_nalloc > tq->tq_minalloc)) && \
(taskq_random < (1771875 / taskq_smtbf))) { \
mutex_exit(&tq->tq_lock); \
- return (NULL); \
+ return ((taskqid_t)NULL); \
}
#else
#define TASKQ_S_RANDOM_DISPATCH_FAILURE(tq, flag)