summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rsi
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-08-05 12:37:46 +0200
committerKalle Valo <kvalo@codeaurora.org>2021-08-21 19:27:16 +0200
commitd0f8430332a16c7baa80ce2886339182c5d85f37 (patch)
tree1cff3e2bbf037c7944a5f55f60234a8bf02879e1 /drivers/net/wireless/rsi
parentray_cs: Split memcpy() to avoid bounds check warning (diff)
downloadlinux-d0f8430332a16c7baa80ce2886339182c5d85f37.tar.xz
linux-d0f8430332a16c7baa80ce2886339182c5d85f37.zip
rsi: fix error code in rsi_load_9116_firmware()
This code returns success if the kmemdup() fails, but obviously it should return -ENOMEM instead. Fixes: e5a1ecc97e5f ("rsi: add firmware loading for 9116 device") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210805103746.GA26417@kili
Diffstat (limited to 'drivers/net/wireless/rsi')
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_hal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c
index 99b21a2c8386..f4a26f16f00f 100644
--- a/drivers/net/wireless/rsi/rsi_91x_hal.c
+++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
@@ -1038,8 +1038,10 @@ static int rsi_load_9116_firmware(struct rsi_hw *adapter)
}
ta_firmware = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
- if (!ta_firmware)
+ if (!ta_firmware) {
+ status = -ENOMEM;
goto fail_release_fw;
+ }
fw_p = ta_firmware;
instructions_sz = fw_entry->size;
rsi_dbg(INFO_ZONE, "FW Length = %d bytes\n", instructions_sz);