ath11k: add missing of_node_put() to avoid leak
Subsystems (3)
PATCH 1/1 ath11k: add missing of_node_put() to avoid leak
The node pointer is returned by of_find_node_by_type() or of_parse_phandle() with refcount incremented. Calling of_node_put() to aovid the refcount leak.
Fixes 6ac04bdc5edb ("ath11k: Use reserved host DDR addresses from DT for PCI devices")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Yang Yingliang <[email protected]>
--- drivers/net/wireless/ath/ath11k/mhi.c | 1 + drivers/net/wireless/ath/ath11k/qmi.c | 1 + 2 files changed, 2 insertions(+)
drivers/net/wireless/ath/ath11k/mhi.c +1 -0
@@ -332,6 +332,7 @@ static int ath11k_mhi_read_addr_from_dt(struct mhi_controller *mhi_ctrl)return -ENOENT ; ret =of_address_to_resource (np,0 , &res); +of_node_put (np);if (ret)return ret;
drivers/net/wireless/ath/ath11k/qmi.c +1 -0
@@ -1892,6 +1892,7 @@ static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab) } ret =of_address_to_resource (hremote_node,0 , &res); +of_node_put (hremote_node);if (ret) {ath11k_dbg (ab,ATH11K_DBG_QMI ,"qmi fail to get reg from hremote\n" );
Signature · 1 line
2.25.1
Quoted 8 lines · Yang Yingliang
The node pointer is returned by
of_find_node_by_type()orof_parse_phandle()with refcount incremented. Callingof_node_put()to aovid the refcount leak.Fixes 6ac04bdc5edb ("ath11k: Use reserved host DDR addresses from DT for PCI devices")Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
3d38faef0de1 ath11k: add missing of_node_put() to avoid leak
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches