diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2022-04-02 17:25:11 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2022-04-02 17:25:11 +0000 |
commit | 3b10f8120b92f68d81dabe9b2f2aa5f0407d46ee (patch) | |
tree | 5c21472f60330039e6a1215bca19382dbbb0f840 | |
parent | 9a99a5db16999cd7df6283e6c8a3160ee8d52528 (diff) |
Add a paranoia/future proofing check for link->pool == NULL to
the SDEV_OWN_IOPL flag check.
Ambiguous/inconsistant code pointed out by Coverity #1515557.
-rw-r--r-- | sys/scsi/scsiconf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 78b2b4131c8..98a9b14d007 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.c,v 1.250 2022/04/02 13:57:39 krw Exp $ */ +/* $OpenBSD: scsiconf.c,v 1.251 2022/04/02 17:25:10 krw Exp $ */ /* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */ /* @@ -802,7 +802,7 @@ scsi_detach_link(struct scsi_link *link, int flags) } /* 3. If it's using the openings io allocator, clean that up. */ - if (ISSET(link->flags, SDEV_OWN_IOPL)) { + if (link->pool != NULL && ISSET(link->flags, SDEV_OWN_IOPL)) { scsi_iopool_destroy(link->pool); free(link->pool, M_DEVBUF, sizeof(*link->pool)); } |