ath11k: fix error handling in ath11k_qmi_assign_target_mem_chunk()
Subsystems (3)
PATCH 1/1 ath11k: fix error handling in ath11k_qmi_assign_target_mem_chunk()
From: Tom Rix <[email protected]>
Clang static analysis reports this problem
qmi.c:1935:5: warning: Undefined or garbage value returned to caller
return ret;
^~~~~~~~~~
ret is uninitialized. When of_parse_phandle() fails, garbage is returned. So return -EINVAL.
--- drivers/net/wireless/ath/ath11k/qmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/qmi.c +1 -1
@@ -1932,7 +1932,7 @@ static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab)if (!hremote_node) {ath11k_dbg (ab,ATH11K_DBG_QMI ,"qmi fail to get hremote_node\n" ); -return ret; +return -EINVAL ; } ret =of_address_to_resource (hremote_node,0 , &res);
Signature · 1 line
2.26.3
Quoted 7 lines · [email protected] wrote:
From: Tom Rix <[email protected]>
Clang static analysis reports this problem
qmi.c:1935:5: warning: Undefined or garbage value returned to caller
return ret;
^~~~~~~~~~
Quoted 5 lines
ret is uninitialized. When
of_parse_phandle()fails, garbage is returned. So return-EINVAL.Fixes 6ac04bdc5edb ("ath11k: Use reserved host DDR addresses from DT for PCI devices")Signed-off-by Tom Rix <[email protected]>
I just applied a fix from Dan:
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=ath-next&id=c9b41832dc08
Patch set to Superseded.
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches