All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rsi: fix error code in rsi_load_9116_firmware()
@ 2021-08-05 10:37 Dan Carpenter
  2021-08-21 17:27 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-08-05 10:37 UTC (permalink / raw)
  To: Amitkumar Karwar, Siva Rebbagondla
  Cc: Kalle Valo, linux-wireless, kernel-janitors

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>
---
 drivers/net/wireless/rsi/rsi_91x_hal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rsi: fix error code in rsi_load_9116_firmware()
  2021-08-05 10:37 [PATCH] rsi: fix error code in rsi_load_9116_firmware() Dan Carpenter
@ 2021-08-21 17:27 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2021-08-21 17:27 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Amitkumar Karwar, Siva Rebbagondla, linux-wireless, kernel-janitors

Dan Carpenter <dan.carpenter@oracle.com> wrote:

> 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>

Patch applied to wireless-drivers-next.git, thanks.

d0f8430332a1 rsi: fix error code in rsi_load_9116_firmware()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210805103746.GA26417@kili/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-21 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 10:37 [PATCH] rsi: fix error code in rsi_load_9116_firmware() Dan Carpenter
2021-08-21 17:27 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.