diff --git a/os_if/linux/spectral/src/os_if_spectral_netlink.c b/os_if/linux/spectral/src/os_if_spectral_netlink.c index 0a7c39627e6e..d345ec799013 100644 --- a/os_if/linux/spectral/src/os_if_spectral_netlink.c +++ b/os_if/linux/spectral/src/os_if_spectral_netlink.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2011, 2017-2019 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -364,6 +364,9 @@ os_if_spectral_nl_unicast_msg(struct wlan_objmgr_pdev *pdev) ps->skb, ps->spectral_pid, MSG_DONTWAIT); + /* clear the local copy */ + ps->skb = NULL; + return status; } #else @@ -399,6 +402,9 @@ os_if_spectral_nl_unicast_msg(struct wlan_objmgr_pdev *pdev) if (status < 0) spectral_err("failed to send to spectral scan app"); + /* clear the local copy */ + ps->skb = NULL; + return status; } @@ -451,6 +457,9 @@ os_if_spectral_nl_bcast_msg(struct wlan_objmgr_pdev *pdev) ps->skb, 0, 1, GFP_ATOMIC); + /* clear the local copy */ + ps->skb = NULL; + return status; } @@ -539,6 +548,8 @@ void os_if_spectral_netlink_deinit(struct wlan_objmgr_pdev *pdev) return; } + os_if_spectral_free_skb(pdev); + if (sptrl_ctx->sptrlc_deregister_netlink_cb) sptrl_ctx->sptrlc_deregister_netlink_cb(pdev); diff --git a/target_if/spectral/target_if_spectral.h b/target_if/spectral/target_if_spectral.h index 3f6b139c539c..39470d984b41 100644 --- a/target_if/spectral/target_if_spectral.h +++ b/target_if/spectral/target_if_spectral.h @@ -1463,9 +1463,10 @@ init_160mhz_delivery_state_machine(struct target_if_spectral *spectral) { */ static inline void deinit_160mhz_delivery_state_machine(struct target_if_spectral *spectral) { - if (spectral->spectral_report_cache) + if (spectral->spectral_report_cache && spectral->nl_cb.free_nbuff) { spectral->nl_cb.free_nbuff(spectral->pdev_obj); - spectral->spectral_report_cache = NULL; + spectral->spectral_report_cache = NULL; + } } /**