mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
frame-xchg: Fix potential use after free
Check if the frame callback has cancelled the frame_xchg before attempting to free it.
This commit is contained in:
parent
40c091ac7f
commit
736aadc75f
@ -975,6 +975,11 @@ static bool frame_xchg_tx_retry(struct wiphy_radio_work_item *item)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool frame_xchg_match_ptr(const void *a, const void *b)
|
||||||
|
{
|
||||||
|
return a == b;
|
||||||
|
}
|
||||||
|
|
||||||
static bool frame_xchg_resp_handle(const struct mmpdu_header *mpdu,
|
static bool frame_xchg_resp_handle(const struct mmpdu_header *mpdu,
|
||||||
const void *body, size_t body_len,
|
const void *body, size_t body_len,
|
||||||
int rssi, void *user_data)
|
int rssi, void *user_data)
|
||||||
@ -1013,6 +1018,9 @@ static bool frame_xchg_resp_handle(const struct mmpdu_header *mpdu,
|
|||||||
|
|
||||||
done = watch->cb(mpdu, body, body_len, rssi, fx->user_data);
|
done = watch->cb(mpdu, body, body_len, rssi, fx->user_data);
|
||||||
|
|
||||||
|
if (!l_queue_find(frame_xchgs, frame_xchg_match_ptr, fx))
|
||||||
|
return true;
|
||||||
|
|
||||||
if (done) {
|
if (done) {
|
||||||
/* NULL callback here since the caller is done */
|
/* NULL callback here since the caller is done */
|
||||||
fx->cb = NULL;
|
fx->cb = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user