Эх сурвалжийг харах

Merge "cnss2: Add NULL check for a few exposed APIs" into wlan-platform.lnx.1.0

CNSS_WLAN Service 3 жил өмнө
parent
commit
6ad2619093
1 өөрчлөгдсөн 9 нэмэгдсэн , 0 устгасан
  1. 9 0
      cnss2/main.c

+ 9 - 0
cnss2/main.c

@@ -324,6 +324,9 @@ int cnss_wlan_enable(struct device *dev,
 	struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev);
 	int ret = 0;
 
+	if (!plat_priv)
+		return -ENODEV;
+
 	if (plat_priv->device_id == QCA6174_DEVICE_ID)
 		return 0;
 
@@ -357,6 +360,9 @@ int cnss_wlan_disable(struct device *dev, enum cnss_driver_mode mode)
 	struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev);
 	int ret = 0;
 
+	if (!plat_priv)
+		return -ENODEV;
+
 	if (plat_priv->device_id == QCA6174_DEVICE_ID)
 		return 0;
 
@@ -432,6 +438,9 @@ int cnss_set_fw_log_mode(struct device *dev, u8 fw_log_mode)
 {
 	struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev);
 
+	if (!plat_priv)
+		return -ENODEV;
+
 	if (plat_priv->device_id == QCA6174_DEVICE_ID)
 		return 0;