diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-08-18 09:26:44 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-08-18 09:26:44 +0000 |
commit | 9b8ed4409d7a86ebaba0d93c3102fec75ed77229 (patch) | |
tree | 9c6a5795677c0638e5f679435389a9af849a4d70 /sys/dev/ic | |
parent | 2ab893a7c9011db37bb6dfded56fd2a311fba289 (diff) |
Avoid a NULL dereference in an error path. Coverity CID 1453201.
ok mikeb@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/nvme.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index e7243e545d4..93e1da33e61 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvme.c,v 1.59 2017/06/12 04:57:42 deraadt Exp $ */ +/* $OpenBSD: nvme.c,v 1.60 2017/08/18 09:26:43 jsg Exp $ */ /* * Copyright (c) 2014 David Gwynne <dlg@openbsd.org> @@ -357,7 +357,7 @@ nvme_attach(struct nvme_softc *sc) sc->sc_hib_q = nvme_q_alloc(sc, NVME_HIB_Q, 4, sc->sc_dstrd); if (sc->sc_hib_q == NULL) { printf("%s: unable to allocate hibernate io queue\n", DEVNAME(sc)); - goto free_hib_q; + goto free_q; } nvme_write4(sc, NVME_INTMC, 1); @@ -381,8 +381,6 @@ nvme_attach(struct nvme_softc *sc) return (0); -free_hib_q: - nvme_q_free(sc, sc->sc_hib_q); free_q: nvme_q_free(sc, sc->sc_q); disable: |