git: 2dcc11d82758 - stable/13 - uath: Avoid a NULL dereference
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 19 Feb 2025 16:25:17 UTC
The branch stable/13 has been updated by jlduran:
URL: https://cgit.FreeBSD.org/src/commit/?id=2dcc11d82758b0b1320dbc16c8ce30b0f8d5b4c5
commit 2dcc11d82758b0b1320dbc16c8ce30b0f8d5b4c5
Author: Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-02-12 15:31:43 +0000
Commit: Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-02-19 16:23:59 +0000
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
(cherry picked from commit 4b77a9a80cf8a9cba5607d8d8fa0742334dcf0f4)
---
sys/dev/usb/wlan/if_uath.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c
index 7d5e50590ea2..480e987a924d 100644
--- a/sys/dev/usb/wlan/if_uath.c
+++ b/sys/dev/usb/wlan/if_uath.c
@@ -2303,10 +2303,12 @@ uath_cmdeof(struct uath_softc *sc, struct uath_cmd *cmd)
__func__, dlen, sizeof(uint32_t));
return;
}
- /* XXX have submitter do this */
- /* copy answer into caller's supplied buffer */
- bcopy(hdr+1, cmd->odata, sizeof(uint32_t));
- cmd->olen = sizeof(uint32_t);
+ if (cmd->odata != NULL) {
+ /* XXX have submitter do this */
+ /* copy answer into caller's supplied buffer */
+ bcopy(hdr+1, cmd->odata, sizeof(uint32_t));
+ cmd->olen = sizeof(uint32_t);
+ }
wakeup_one(cmd); /* wake up caller */
break;