msm: ipa: add null check for unregister netdev
Changes include null check for IPA netdev and gsihal_ctx. Change-Id: If897281663e0ae0f29b7110fcbaa4dd98f67eb8d Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
This commit is contained in:
@@ -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);
|
||||
|
@@ -3755,7 +3755,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);
|
||||
@@ -3985,7 +3986,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());
|
||||
|
Reference in New Issue
Block a user