Преглед изворни кода

qcacld-3.0: Fix lro dereg crash on driver unload

If lro_disable is called after  cds_close, which is the case
for module unloads, then many of the pointers used in dereg
sequence are NULL (CE_state, hif, txrx_pdev). There is a case,
when interfaces are removed, when these pointers are there.
Check pointers before using them in dereg code.
Update hif_map_service_to_pipe so that it will return E_INVAL if
the service is not in the table. Add logs for cases where either
leg information is not updated on return.

Acked-by: Orhan K AKYILDIZ <[email protected]>

Change-Id: I5b88a297134dcc1d7a6a68dd2a9879dfd1553a7e
CRs-Fixed: 1014428
Manjunathappa Prakash пре 9 година
родитељ
комит
ef45abaa6e
1 измењених фајлова са 10 додато и 4 уклоњено
  1. 10 4
      core/dp/txrx/ol_txrx.c

+ 10 - 4
core/dp/txrx/ol_txrx.c

@@ -3919,8 +3919,11 @@ void ol_register_lro_flush_cb(void (handler)(void *), void *data)
 		(struct hif_opaque_softc *)cds_get_context(QDF_MODULE_ID_HIF);
 	struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
-	pdev->lro_info.lro_flush_cb = handler;
-	pdev->lro_info.lro_data = data;
+	if (pdev != NULL) {
+		pdev->lro_info.lro_flush_cb = handler;
+		pdev->lro_info.lro_data = data;
+	} else
+		TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s: pdev NULL!", __func__);
 
 	hif_lro_flush_cb_register(hif_device, ol_txrx_lro_flush, pdev);
 }
@@ -3942,8 +3945,11 @@ void ol_deregister_lro_flush_cb(void)
 
 	hif_lro_flush_cb_deregister(hif_device);
 
-	pdev->lro_info.lro_flush_cb = NULL;
-	pdev->lro_info.lro_data = NULL;
+	if (pdev != NULL) {
+		pdev->lro_info.lro_flush_cb = NULL;
+		pdev->lro_info.lro_data = NULL;
+	} else
+		TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s: pdev NULL!", __func__);
 }
 #endif /* FEATURE_LRO */