summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/io/fibre-channel
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-18 19:30:18 +0200
committerToomas Soome <tsoome@me.com>2019-04-10 08:54:49 +0300
commit95369d7b997316a0170a6c243bfbfc61d1258fb5 (patch)
tree5fde9eb490856ca6a2586370f3530129907f57c5 /usr/src/uts/common/io/fibre-channel
parent3aedb073327854aba1e08f2cd606208552e0ea55 (diff)
downloadillumos-gate-95369d7b997316a0170a6c243bfbfc61d1258fb5.tar.gz
10634 qlge: NULL pointer errors
Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Gergő Doma <domag02@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/uts/common/io/fibre-channel')
-rw-r--r--usr/src/uts/common/io/fibre-channel/fca/qlge/qlge.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/usr/src/uts/common/io/fibre-channel/fca/qlge/qlge.c b/usr/src/uts/common/io/fibre-channel/fca/qlge/qlge.c
index 213dbc51b0..cf20b75a66 100644
--- a/usr/src/uts/common/io/fibre-channel/fca/qlge/qlge.c
+++ b/usr/src/uts/common/io/fibre-channel/fca/qlge/qlge.c
@@ -1159,9 +1159,9 @@ ql_refill_sbuf_free_list(struct bq_desc *sbq_desc, boolean_t alloc_memory)
/*
* If we are freeing the buffers as a result of adapter unload, get out
*/
- if ((sbq_desc->free_buf != NULL) ||
+ if ((sbq_desc->free_buf != 0) ||
(qlge->mac_flags == QL_MAC_DETACH)) {
- if (sbq_desc->free_buf == NULL)
+ if (sbq_desc->free_buf == 0)
atomic_dec_32(&rx_ring->rx_indicate);
mutex_exit(&rx_ring->sbq_lock);
return;
@@ -1272,9 +1272,9 @@ ql_refill_lbuf_free_list(struct bq_desc *lbq_desc, boolean_t alloc_memory)
/*
* If we are freeing the buffers as a result of adapter unload, get out
*/
- if ((lbq_desc->free_buf != NULL) ||
+ if ((lbq_desc->free_buf != 0) ||
(qlge->mac_flags == QL_MAC_DETACH)) {
- if (lbq_desc->free_buf == NULL)
+ if (lbq_desc->free_buf == 0)
atomic_dec_32(&rx_ring->rx_indicate);
mutex_exit(&rx_ring->lbq_lock);
return;
@@ -5022,12 +5022,9 @@ typedef uint8_t ub1;
}
ub4
-hash(k, length, initval)
-register ub1 *k; /* the key */
-register ub4 length; /* the length of the key */
-register ub4 initval; /* the previous hash, or an arbitrary value */
+hash(ub1 *k, ub4 length, ub4 initval)
{
- register ub4 a, b, c, len;
+ ub4 a, b, c, len;
/* Set up the internal state */
len = length;
@@ -5199,7 +5196,7 @@ ql_hw_lso_setup(qlge_t *qlge, uint32_t mss, caddr_t bp,
if (IPH_HDR_VERSION((ipha_t *)(void *)(bp + mac_hdr_len)) ==
IPV4_VERSION) {
if (etherType == ETHERTYPE_IP /* 0800 */) {
- iphdr = (struct ip *)(void *)(bp+mac_hdr_len);
+ iphdr = (struct ip *)(void *)(bp+mac_hdr_len);
} else {
/* EMPTY */
QL_PRINT(DBG_TX, ("%s(%d) : IPv4 None IP packet"
@@ -5353,7 +5350,7 @@ ql_send_common(struct tx_ring *tx_ring, mblk_t *mp)
cmn_err(CE_NOTE, "%s: quit, packet oversize %d\n",
__func__, (int)total_len);
#endif
- return (NULL);
+ return (0);
}
bp = (caddr_t)mp->b_rptr;
@@ -8034,7 +8031,7 @@ static struct modldrv modldrv = {
};
static struct modlinkage modlinkage = {
- MODREV_1, &modldrv, NULL
+ MODREV_1, &modldrv, NULL
};
/*