diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-10-04 09:46:32 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-10-04 09:46:32 +0000 |
commit | 113020a935e8150009cbd72394f6223d1b9efad8 (patch) | |
tree | 02f782d54a6e086ad0a86c9ee5fb47a3842324c0 /sys/dev/pv/hyperv.c | |
parent | c83dbfd844cdb6f7729dc2901c3bc7ab0108b2dd (diff) |
Check the actual pointer returned by km_alloc(9) instead of the array. The
latter will always be non-NULL, and therefore the test will always be false.
Caught by clang.
ok jca@, mikeb@, jsg@
Diffstat (limited to 'sys/dev/pv/hyperv.c')
-rw-r--r-- | sys/dev/pv/hyperv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pv/hyperv.c b/sys/dev/pv/hyperv.c index 0a737e8ff0c..7641751d56d 100644 --- a/sys/dev/pv/hyperv.c +++ b/sys/dev/pv/hyperv.c @@ -700,7 +700,7 @@ hv_vmbus_connect(struct hv_softc *sc) sc->sc_revents = (u_long *)((caddr_t)sc->sc_events + (PAGE_SIZE >> 1)); sc->sc_monitor[0] = km_alloc(PAGE_SIZE, &kv_any, &kp_zero, &kd_nowait); - if (sc->sc_monitor == NULL) { + if (sc->sc_monitor[0] == NULL) { printf(": failed to allocate monitor page 1\n"); goto errout; } @@ -710,7 +710,7 @@ hv_vmbus_connect(struct hv_softc *sc) } sc->sc_monitor[1] = km_alloc(PAGE_SIZE, &kv_any, &kp_zero, &kd_nowait); - if (sc->sc_monitor == NULL) { + if (sc->sc_monitor[1] == NULL) { printf(": failed to allocate monitor page 2\n"); goto errout; } |