qcacld-3.0: Fix function type for wdi_event_sub

To address kernel control flow integrity (CFI) issues related to type
mismatch, correct the return type of wdi_event_sub().

Change-Id: Id51c6523ddd5d6f5835f7aa08a3a7b2940d2c50b
CRs-Fixed: 2402961
This commit is contained in:
Rajeev Kumar Sirasanagandla
2019-01-29 13:07:30 -08:00
committed by nshrivas
parent 815a7dfa5d
commit 0ce92bf6d5
2 changed files with 13 additions and 13 deletions

View File

@@ -98,7 +98,7 @@ wdi_event_handler(enum WDI_EVENT event,
wdi_event_iter_sub(txrx_pdev, event_index, wdi_sub, data);
}
A_STATUS
int
wdi_event_sub(struct cdp_pdev *ppdev,
void *pevent_cb_sub, uint32_t event)
{
@@ -114,17 +114,17 @@ wdi_event_sub(struct cdp_pdev *ppdev,
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"Invalid txrx_pdev or wdi_event_list in %s",
__func__);
return A_ERROR;
return -EINVAL;
}
if (!event_cb_sub) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"Invalid callback in %s", __func__);
return A_ERROR;
return -EINVAL;
}
if ((!event) || (event >= WDI_EVENT_LAST) || (event < WDI_EVENT_BASE)) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"Invalid event in %s", __func__);
return A_ERROR;
return -EINVAL;
}
/* Input validation */
event_index = event - WDI_EVENT_BASE;
@@ -138,14 +138,14 @@ wdi_event_sub(struct cdp_pdev *ppdev,
wdi_sub->priv.next = NULL;
wdi_sub->priv.prev = NULL;
txrx_pdev->wdi_event_list[event_index] = wdi_sub;
return A_OK;
return 0;
}
event_cb_sub->priv.next = wdi_sub;
event_cb_sub->priv.prev = NULL;
wdi_sub->priv.prev = event_cb_sub;
txrx_pdev->wdi_event_list[event_index] = event_cb_sub;
return A_OK;
return 0;
}
int

View File

@@ -37,11 +37,11 @@ struct ol_txrx_pdev_t;
* @param pdev - the event physical device, that maintains the event lists
* @param event_cb_sub - the callback and context for the event subscriber
* @param event - which event's notifications are being subscribed to
* @return error code, or A_OK for success
* @return error code, or 0 for success
*/
A_STATUS wdi_event_sub(struct cdp_pdev *ppdev,
void *event_cb_sub,
uint32_t event);
int wdi_event_sub(struct cdp_pdev *ppdev,
void *event_cb_sub,
uint32_t event);
/**
* @brief Unsubscribe from a specified WDI event.
@@ -83,10 +83,10 @@ static inline A_STATUS wdi_event_detach(struct ol_txrx_pdev_t *txrx_pdev)
return A_OK;
}
static inline A_STATUS wdi_event_sub(struct cdp_pdev *ppdev, void *event_cb_sub,
uint32_t event)
static inline int wdi_event_sub(struct cdp_pdev *ppdev, void *event_cb_sub,
uint32_t event)
{
return A_OK;
return 0;
}
static inline int wdi_event_unsub(struct cdp_pdev *ppdev,