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

Merge "msm: ipa: add null check for unregister netdev"

qctecmdr пре 3 година
родитељ
комит
bf2a8f464b

+ 5 - 0
drivers/platform/msm/gsi/gsihal/gsihal_reg.c

@@ -2003,6 +2003,11 @@ u32 gsihal_read_reg_nk(enum gsihal_reg_name reg, u32 n, u32 k)
 {
 	u32 offset;
 
+	if (!gsihal_ctx) {
+		GSIERR("gsihal_ctx mpt initialized");
+		return -EPERM;
+	}
+
 	if (reg >= GSI_REG_MAX) {
 		GSIERR("Invalid register reg=%u\n", reg);
 		WARN_ON(1);

+ 4 - 2
drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c

@@ -3759,7 +3759,8 @@ static int ipa3_wwan_remove(struct platform_device *pdev)
 	 * targets. */
 #if !IS_ENABLED(CONFIG_QCOM_Q6V5_PAS)
 	IPAWANINFO("rmnet_ipa unregister_netdev\n");
-	unregister_netdev(IPA_NETDEV());
+	if (IPA_NETDEV())
+		unregister_netdev(IPA_NETDEV());
 	ipa3_wwan_deregister_netdev_pm_client();
 #endif
 	cancel_work_sync(&ipa3_tx_wakequeue_work);
@@ -3989,7 +3990,8 @@ static int ipa3_lcl_mdm_ssr_notifier_cb(struct notifier_block *this,
 		 * enabled targets. */
 #if IS_ENABLED(CONFIG_QCOM_Q6V5_PAS)
 		IPAWANINFO("rmnet_ipa unregister_netdev\n");
-		unregister_netdev(IPA_NETDEV());
+		if (IPA_NETDEV())
+			unregister_netdev(IPA_NETDEV());
 		ipa3_wwan_deregister_netdev_pm_client();
 		if (IPA_NETDEV())
 			free_netdev(IPA_NETDEV());