Skip to content

Commit

Permalink
rsi: fix error code in rsi_load_9116_firmware()
Browse files Browse the repository at this point in the history
[ Upstream commit d0f8430 ]

This code returns success if the kmemdup() fails, but obviously it
should return -ENOMEM instead.

Fixes: e5a1ecc ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dan Carpenter authored and gregkh committed Sep 15, 2021
1 parent b4bbb77 commit 110ce7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/wireless/rsi/rsi_91x_hal.c
Expand Up @@ -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);
Expand Down

0 comments on commit 110ce7d

Please sign in to comment.