qcacmn: Add SSR protection to os_if_wifi_pos_callback()
Protect SSR protection for wifi pos callback function to prevent possible race condition between user request and driver unload. Change-Id: I68d3636429f8891f0a4d6c78642aeecf7d67e105 CRs-Fixed: 2349354
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
* component's os_if layer.
|
* component's os_if layer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "qdf_platform.h"
|
||||||
#include "wlan_nlink_srv.h"
|
#include "wlan_nlink_srv.h"
|
||||||
#include "wlan_ptt_sock_svc.h"
|
#include "wlan_ptt_sock_svc.h"
|
||||||
#include "wlan_nlink_common.h"
|
#include "wlan_nlink_common.h"
|
||||||
@@ -149,15 +150,15 @@ static int wifi_pos_parse_req(struct sk_buff *skb, struct wifi_pos_req_msg *req)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* os_if_wifi_pos_callback() - callback registered with NL service socket to
|
* __os_if_wifi_pos_callback() - callback registered with NL service socket to
|
||||||
* process wifi pos request
|
* process wifi pos request
|
||||||
* @skb: request message sk_buff
|
* @skb: request message sk_buff
|
||||||
*
|
*
|
||||||
* Return: status of operation
|
* Return: status of operation
|
||||||
*/
|
*/
|
||||||
#ifdef CNSS_GENL
|
#ifdef CNSS_GENL
|
||||||
static void os_if_wifi_pos_callback(const void *data, int data_len,
|
static void __os_if_wifi_pos_callback(const void *data, int data_len,
|
||||||
void *ctx, int pid)
|
void *ctx, int pid)
|
||||||
{
|
{
|
||||||
uint8_t err;
|
uint8_t err;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
@@ -187,8 +188,20 @@ static void os_if_wifi_pos_callback(const void *data, int data_len,
|
|||||||
release_psoc_ref:
|
release_psoc_ref:
|
||||||
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_OSIF_ID);
|
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_OSIF_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void os_if_wifi_pos_callback(const void *data, int data_len,
|
||||||
|
void *ctx, int pid)
|
||||||
|
{
|
||||||
|
struct qdf_op_sync *op_sync;
|
||||||
|
|
||||||
|
if (qdf_op_protect(&op_sync))
|
||||||
|
return;
|
||||||
|
|
||||||
|
__os_if_wifi_pos_callback(data, data_len, ctx, pid);
|
||||||
|
qdf_op_unprotect(op_sync);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static int os_if_wifi_pos_callback(struct sk_buff *skb)
|
static int __os_if_wifi_pos_callback(struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
uint8_t err;
|
uint8_t err;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
@@ -220,6 +233,20 @@ release_psoc_ref:
|
|||||||
|
|
||||||
return qdf_status_to_os_return(status);
|
return qdf_status_to_os_return(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int os_if_wifi_pos_callback(struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
struct qdf_op_sync *op_sync;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
if (qdf_op_protect(&op_sync))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
err = __os_if_wifi_pos_callback(skb);
|
||||||
|
qdf_op_unprotect(op_sync);
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CNSS_GENL
|
#ifdef CNSS_GENL
|
||||||
|
@@ -24,6 +24,8 @@
|
|||||||
#ifndef _QDF_PLATFORM_H
|
#ifndef _QDF_PLATFORM_H
|
||||||
#define _QDF_PLATFORM_H
|
#define _QDF_PLATFORM_H
|
||||||
|
|
||||||
|
#include "qdf_types.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qdf_self_recovery_callback() - callback for self recovery
|
* qdf_self_recovery_callback() - callback for self recovery
|
||||||
* @reason: the reason for the recovery request
|
* @reason: the reason for the recovery request
|
||||||
|
Reference in New Issue
Block a user