Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb052c81 authored by Utkarsh Saxena's avatar Utkarsh Saxena Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: Fix race condition between shared memory



Protect the common shared wlan_comm_desc_list with
spin lock to avoid the race condition.

Change-Id: I02ef6c6b663340711e0e2f766424d642aaa8d7af
Acked-by: default avatarMohammed Javid <mjavid@qti.qualcomm.com>
Signed-off-by: default avatarUtkarsh Saxena <usaxena@codeaurora.org>
parent a9ef16da
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1934,11 +1934,13 @@ static void ipa_alloc_wlan_rx_common_cache(u32 size)
			goto fail_dma_mapping;
			goto fail_dma_mapping;
		}
		}


		spin_lock_bh(&ipa_ctx->wc_memb.wlan_spinlock);
		list_add_tail(&rx_pkt->link,
		list_add_tail(&rx_pkt->link,
			&ipa_ctx->wc_memb.wlan_comm_desc_list);
			&ipa_ctx->wc_memb.wlan_comm_desc_list);
		rx_len_cached = ++ipa_ctx->wc_memb.wlan_comm_total_cnt;
		rx_len_cached = ++ipa_ctx->wc_memb.wlan_comm_total_cnt;


		ipa_ctx->wc_memb.wlan_comm_free_cnt++;
		ipa_ctx->wc_memb.wlan_comm_free_cnt++;
		spin_unlock_bh(&ipa_ctx->wc_memb.wlan_spinlock);


	}
	}