Skip to content

Commit

Permalink
10424 uts: NULL pointer errors in DEBUG build
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tsoome committed Feb 20, 2019
1 parent f1ccfd8 commit a8b4e7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions usr/src/uts/common/os/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -76,15 +76,15 @@ 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 */

#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 */
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -642,7 +642,7 @@ getblk_common(void * arg, dev_t dev, daddr_t blkno, long bsize, int errflg)
notavail(bp);
mutex_exit(hmp);

ASSERT((bp->b_flags & B_NOCACHE) == NULL);
ASSERT((bp->b_flags & B_NOCACHE) == 0);

if (nbp == NULL) {
/*
Expand Down Expand Up @@ -716,7 +716,7 @@ getblk_common(void * arg, dev_t dev, daddr_t blkno, long bsize, int errflg)
nbp->b_vp = NULL;
}

ASSERT((nbp->b_flags & B_NOCACHE) == NULL);
ASSERT((nbp->b_flags & B_NOCACHE) == 0);

binshash(nbp, dp);
mutex_exit(hmp);
Expand Down
4 changes: 2 additions & 2 deletions usr/src/uts/common/os/taskq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand All @@ -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)
Expand Down

0 comments on commit a8b4e7c

Please sign in to comment.