summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2024-02-08 11:13:02 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2024-02-08 11:13:02 +0000
commit42ad557625779621d0ae06ef8b7bf46a0242ffed (patch)
tree9f1c01765b75d4cdc0df4352f8c00d4d3e138fed /sys/dev/ic
parent169af61d5e685d0b4961dbe48e9fed8c973bb6bd (diff)
fix uninitialized return from qwx_qmi_load_file_target_mem()
Fortunately this case could only be reached with an empty firmware file. Found by jsg@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/qwx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ic/qwx.c b/sys/dev/ic/qwx.c
index b20a2fd3e16..6d4527720cf 100644
--- a/sys/dev/ic/qwx.c
+++ b/sys/dev/ic/qwx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qwx.c,v 1.20 2024/02/08 11:09:53 stsp Exp $ */
+/* $OpenBSD: qwx.c,v 1.21 2024/02/08 11:13:01 stsp Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
@@ -8249,7 +8249,7 @@ qwx_qmi_load_file_target_mem(struct qwx_softc *sc, const u_char *data,
#ifdef notyet
void *bdf_addr = NULL;
#endif
- int ret;
+ int ret = EINVAL; /* empty fw image */
uint32_t remaining = len;
req = malloc(sizeof(*req), M_DEVBUF, M_NOWAIT | M_ZERO);
@@ -8393,7 +8393,7 @@ qwx_qmi_load_bdf_qmi(struct qwx_softc *sc, int regdb)
fw_size = MIN(sc->hw_params.fw.board_size, boardfw_len);
ret = qwx_qmi_load_file_target_mem(sc, boardfw, fw_size, bdf_type);
- if (ret < 0) {
+ if (ret) {
printf("%s: failed to load bdf file\n", __func__);
goto out;
}