Skip to contentSkip to conversation

ath11k: return -ENOMEM on allocation failure

PATCH In review Dan Carpenter 2 participants 3 messages Aug 26, 2020 – Aug 27, 2020

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

PATCH 1/1 ath11k: return -ENOMEM on allocation failure

Returning PTR_ERR(NULL) means success, but we should return -ENOMEM.

Fixes 1399fb87ea3e ("ath11k: register MHI controller device for QCA6390")
---
 drivers/net/wireless/ath/ath11k/mhi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/mhi.c +1 -1
index d7e60dc5b300..aded9a719d51 100644
@@ -220,7 +220,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
 
 	mhi_ctrl = kzalloc(sizeof(*mhi_ctrl), GFP_KERNEL);
 	if (!mhi_ctrl)
-		return PTR_ERR(mhi_ctrl);
+		return -ENOMEM;
 
 	ath11k_core_create_firmware_path(ab, ATH11K_AMSS_FILE,
 					 ab_pci->amss_path,
Signature · 1 line
2.28.0
#1 lore raw
Quoted 5 lines · Dan Carpenter

Returning PTR_ERR(NULL) means success, but we should return -ENOMEM.

Fixes 1399fb87ea3e ("ath11k: register MHI controller device for QCA6390")

Patch applied to ath-next branch of ath.git, thanks.

fd0a09097233 ath11k: return -ENOMEM on allocation failure

Signature · 3 lines
https://patchwork.kernel.org/patch/11738005/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw
In reply to Dan Carpenter
Quoted 5 lines · Dan Carpenter

Returning PTR_ERR(NULL) means success, but we should return -ENOMEM.

Fixes 1399fb87ea3e ("ath11k: register MHI controller device for QCA6390")

Patch applied to ath-next branch of ath.git, thanks.

fd0a09097233 ath11k: return -ENOMEM on allocation failure

Signature · 9 lines
https://patchwork.kernel.org/patch/11738005/

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


-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k