Sfoglia il codice sorgente

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
Rajeev Kumar Sirasanagandla 6 anni fa
parent
commit
815a7dfa5d
2 ha cambiato i file con 13 aggiunte e 13 eliminazioni
  1. 4 4
      core/dp/txrx/ol_txrx_event.c
  2. 9 9
      core/dp/txrx/wdi_event_api.h

+ 4 - 4
core/dp/txrx/ol_txrx_event.c

@@ -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
  * 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;
 }
 
-A_STATUS
+int
 wdi_event_unsub(struct cdp_pdev *ppdev,
 		void *pevent_cb_sub, uint32_t event)
 {
@@ -164,7 +164,7 @@ wdi_event_unsub(struct cdp_pdev *ppdev,
 	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_cb_sub->priv.prev) {
 		txrx_pdev->wdi_event_list[event_index] =
@@ -177,7 +177,7 @@ wdi_event_unsub(struct cdp_pdev *ppdev,
 
 	/* qdf_mem_free(event_cb_sub); */
 
-	return A_OK;
+	return 0;
 }
 
 A_STATUS wdi_event_attach(struct ol_txrx_pdev_t *txrx_pdev)

+ 9 - 9
core/dp/txrx/wdi_event_api.h

@@ -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
  * 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 event_cb_sub - the event subscription object
  * @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,
-			 void *event_cb_sub,
-			 uint32_t event);
+int wdi_event_unsub(struct cdp_pdev *ppdev,
+		    void *event_cb_sub,
+		    uint32_t 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;
 }
 
-static inline A_STATUS wdi_event_unsub(struct cdp_pdev *ppdev,
-				       void *event_cb_sub,
-				       uint32_t event)
+static inline int wdi_event_unsub(struct cdp_pdev *ppdev,
+				  void *event_cb_sub,
+				  uint32_t event)
 {
-	return A_OK;
+	return 0;
 }
 #endif /* WDI_EVENT_ENABLE */