qcacld-3.0: Fix function type for wdi_event_unsub

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

Change-Id: I45d090cb4011ca659e30b2f7be6c2b7d32bbba4b
CRs-Fixed: 2402957
This commit is contained in:
Rajeev Kumar Sirasanagandla
2019-01-29 11:04:17 -08:00
committed by nshrivas
parent 1d31b08769
commit 815a7dfa5d
2 changed files with 13 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -148,7 +148,7 @@ wdi_event_sub(struct cdp_pdev *ppdev,
return A_OK; return A_OK;
} }
A_STATUS int
wdi_event_unsub(struct cdp_pdev *ppdev, wdi_event_unsub(struct cdp_pdev *ppdev,
void *pevent_cb_sub, uint32_t event) void *pevent_cb_sub, uint32_t event)
{ {
@@ -164,7 +164,7 @@ wdi_event_unsub(struct cdp_pdev *ppdev,
if (!event_cb_sub) { if (!event_cb_sub) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"Invalid callback in %s", __func__); "Invalid callback in %s", __func__);
return A_ERROR; return -EINVAL;
} }
if (!event_cb_sub->priv.prev) { if (!event_cb_sub->priv.prev) {
txrx_pdev->wdi_event_list[event_index] = txrx_pdev->wdi_event_list[event_index] =
@@ -177,7 +177,7 @@ wdi_event_unsub(struct cdp_pdev *ppdev,
/* qdf_mem_free(event_cb_sub); */ /* qdf_mem_free(event_cb_sub); */
return A_OK; return 0;
} }
A_STATUS wdi_event_attach(struct ol_txrx_pdev_t *txrx_pdev) A_STATUS wdi_event_attach(struct ol_txrx_pdev_t *txrx_pdev)

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012-2014, 2017-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2014, 2017-2019 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -54,11 +54,11 @@ A_STATUS wdi_event_sub(struct cdp_pdev *ppdev,
* @param pdev - the event physical device with the list of event subscribers * @param pdev - the event physical device with the list of event subscribers
* @param event_cb_sub - the event subscription object * @param event_cb_sub - the event subscription object
* @param event - which event is being unsubscribed * @param event - which event is being unsubscribed
* @return error code, or A_OK for success * @return error code, or 0 for success
*/ */
A_STATUS wdi_event_unsub(struct cdp_pdev *ppdev, int wdi_event_unsub(struct cdp_pdev *ppdev,
void *event_cb_sub, void *event_cb_sub,
uint32_t event); uint32_t event);
void wdi_event_handler(enum WDI_EVENT event, void wdi_event_handler(enum WDI_EVENT event,
@@ -89,11 +89,11 @@ static inline A_STATUS wdi_event_sub(struct cdp_pdev *ppdev, void *event_cb_sub,
return A_OK; return A_OK;
} }
static inline A_STATUS wdi_event_unsub(struct cdp_pdev *ppdev, static inline int wdi_event_unsub(struct cdp_pdev *ppdev,
void *event_cb_sub, void *event_cb_sub,
uint32_t event) uint32_t event)
{ {
return A_OK; return 0;
} }
#endif /* WDI_EVENT_ENABLE */ #endif /* WDI_EVENT_ENABLE */