Skip to content

Commit 4b77a9a

Browse files
committed
uath: Avoid a NULL dereference
PR: 284643 Reviewed by: adrian Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48948
1 parent 8d9c25c commit 4b77a9a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sys/dev/usb/wlan/if_uath.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -2308,10 +2308,12 @@ uath_cmdeof(struct uath_softc *sc, struct uath_cmd *cmd)
23082308
__func__, dlen, sizeof(uint32_t));
23092309
return;
23102310
}
2311-
/* XXX have submitter do this */
2312-
/* copy answer into caller's supplied buffer */
2313-
bcopy(hdr+1, cmd->odata, sizeof(uint32_t));
2314-
cmd->olen = sizeof(uint32_t);
2311+
if (cmd->odata != NULL) {
2312+
/* XXX have submitter do this */
2313+
/* copy answer into caller's supplied buffer */
2314+
bcopy(hdr+1, cmd->odata, sizeof(uint32_t));
2315+
cmd->olen = sizeof(uint32_t);
2316+
}
23152317
wakeup_one(cmd); /* wake up caller */
23162318
break;
23172319

0 commit comments

Comments
 (0)