qcacmn: Fix CFI failure caused by dfs_remove_from_nol

The parameter of callback of kernel struct hrtimer is itself, not
qdf_hrtimer_data_t. CFI failure happens if the function pointers
does not have the same type as the function that's called.
Add a new API __qdf_hrtimer_cb and assign it to hrtimer->function.

Change-Id: I9cf753272dd37635e82defac6cf7258c7a70425d
CRs-Fixed: 3245385
This commit is contained in:
Bing Sun
2022-07-25 10:25:31 +08:00
gecommit door Madan Koyyalamudi
bovenliggende d7c3414ca0
commit d0385d035d
3 gewijzigde bestanden met toevoegingen van 23 en 10 verwijderingen

Bestand weergeven

@@ -168,11 +168,9 @@ void dfs_process_cac_completion(void *context)
static enum qdf_hrtimer_restart_status
dfs_cac_timeout(qdf_hrtimer_data_t *arg)
{
struct wlan_dfs *dfs = NULL;
void *ptr = (void *)arg;
qdf_hrtimer_data_t *thr = container_of(ptr, qdf_hrtimer_data_t, u);
struct wlan_dfs *dfs;
dfs = container_of(thr, struct wlan_dfs, dfs_cac_timer);
dfs = container_of(arg, struct wlan_dfs, dfs_cac_timer);
if (dfs_is_hw_mode_switch_in_progress(dfs))
dfs->dfs_defer_params.is_cac_completed = true;

Bestand weergeven

@@ -235,10 +235,8 @@ static enum qdf_hrtimer_restart_status
dfs_remove_from_nol(qdf_hrtimer_data_t *arg)
{
struct dfs_nolelem *nol_arg;
void *ptr = (void *)arg;
qdf_hrtimer_data_t *thr = container_of(ptr, qdf_hrtimer_data_t, u);
nol_arg = container_of(thr, struct dfs_nolelem, nol_timer);
nol_arg = container_of(arg, struct dfs_nolelem, nol_timer);
qdf_sched_work(NULL, &nol_arg->nol_timer_completion_work);