From 57357d211e7d67d449f8a9ad697474da1691908c Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 17 Aug 2015 19:09:24 -0700 Subject: qcacld-2.0: SSR-protect iw_get_tx_power() Currently iw_get_tx_power() does not use the SSR protection wrapper. This can lead to unexpected behavior if the function is executing concurrently with SSR, so add the SSR protection wrapper. Change-Id: I20e5c442484399631553d7495d4bb594447ffc15 CRs-Fixed: 891029 --- CORE/HDD/src/wlan_hdd_wext.c | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index dd30915e6488..1cd8b532692f 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -2193,9 +2193,18 @@ static int iw_get_freq(struct net_device *dev, struct iw_request_info *info, return ret; } -static int iw_get_tx_power(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +/** + * __iw_get_tx_power() - SIOCGIWTXPOW ioctl handler + * @dev: device upon which the ioctl was received + * @info: ioctl request information + * @wrqu: ioctl request data + * @extra: ioctl extra data + * + * Return: 0 on success, non-zero on error + */ +static int __iw_get_tx_power(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -2220,6 +2229,28 @@ static int iw_get_tx_power(struct net_device *dev, return 0; } +/** + * iw_get_tx_power() - SSR wrapper for __iw_get_tx_power() + * @dev: pointer to net_device + * @info: pointer to iw_request_info + * @wrqu: pointer to iwreq_data + * @extra: pointer to extra ioctl payload + * + * Return: 0 on success, error number otherwise + */ +static int iw_get_tx_power(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __iw_get_tx_power(dev, info, wrqu, extra); + vos_ssr_unprotect(__func__); + + return ret; +} + /** * __iw_set_tx_power() - SIOCSIWTXPOW ioctl handler * @dev: device upon which the ioctl was received -- cgit v1.2.3