diff options
| author | riastradh <riastradh@NetBSD.org> | 2021-05-23 08:42:47 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2021-05-23 08:42:47 +0000 |
| commit | fd7873121d03e319e61fab288bf30f7c734ce343 (patch) | |
| tree | c4acea98c8ad523ee600ae7cf0cc52af74e29c22 /sys/dev | |
| parent | 96f1ac980e989c3fefe42f427d9664bcb0b52204 (diff) | |
umass(4): Assert that we got a cb up front.
Avoids jump to zero waaaaaaay down the line where we've forgotten why
we wanted to jump into oblivion.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/umass.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 243a1356214..06819bf1190 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,4 +1,4 @@ -/* $NetBSD: umass.c,v 1.184 2020/04/13 09:26:43 jdolecek Exp $ */ +/* $NetBSD: umass.c,v 1.185 2021/05/23 08:42:47 riastradh Exp $ */ /* * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -124,7 +124,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.184 2020/04/13 09:26:43 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.185 2021/05/23 08:42:47 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -1177,6 +1177,7 @@ umass_bbb_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen, sc, cb, priv, data, datalen, dir, timeout); static int dCBWtag = 42; /* unique for CBW of transfer */ + KASSERT(cb); DPRINTFM(UDMASS_BBB, "sc %#jx cmd=0x%02jx", (uintptr_t)sc, *(u_char *)cmd, 0, 0); @@ -1708,6 +1709,7 @@ umass_cbi_transfer(struct umass_softc *sc, int lun, DPRINTFM(UDMASS_CBI, "sc %#jx: cmd=0x%02jx, len=%jd", (uintptr_t)sc, *(u_char *)cmd, datalen, 0); + KASSERT(cb); KASSERTMSG(sc->sc_wire & (UMASS_WPROTO_CBI|UMASS_WPROTO_CBI_I), "sc->sc_wire == 0x%02x wrong for umass_cbi_transfer\n", sc->sc_wire); |
