Skip to contentSkip to conversation

mwifiex: missing error code on allocation failure

PATCH In review Dan Carpenter 2 participants 2 messages Apr 19, 2016 – Apr 26, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mwifiex: missing error code on allocation failure

We accidentally return success instead of -ENOMEM.

drivers/net/wireless/marvell/mwifiex/usb.c +3 -1
index 0510861..cdd8f9a 100644
@@ -1017,8 +1017,10 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
 
 	/* Allocate memory for receive */
 	recv_buff = kzalloc(FW_DNLD_RX_BUF_SIZE, GFP_KERNEL);
-	if (!recv_buff)
+	if (!recv_buff) {
+		ret = -ENOMEM;
 		goto cleanup;
+	}
 
 	do {
 		/* Send pseudo data to check winner status first */
#1 lore raw
Quoted 4 lines

We accidentally return success instead of -ENOMEM.

Thanks, 2 patches applied to wireless-drivers-next.git:

e0bdef0f75f0 mwifiex: missing error code on allocation failure 394f0ed53108 mwifiex: fix loop timeout in mwifiex_prog_fw_w_helper()

Kalle Valo