Skip to content

Commit d505d35

Browse files
Jinjie Ruandavem330
authored andcommitted
net: wwan: qcom_bam_dmux: Fix missing pm_runtime_disable()
It's important to undo pm_runtime_use_autosuspend() with pm_runtime_dont_use_autosuspend() at driver exit time. But the pm_runtime_disable() and pm_runtime_dont_use_autosuspend() is missing in the error path for bam_dmux_probe(). So add it. Found by code review. Compile-tested only. Fixes: 21a0ffd ("net: wwan: Add Qualcomm BAM-DMUX WWAN network driver") Suggested-by: Stephan Gerhold <[email protected]> Signed-off-by: Jinjie Ruan <[email protected]> Reviewed-by: Stephan Gerhold <[email protected]> Reviewed-by: Sergey Ryazanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3a39d67 commit d505d35

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/net/wwan/qcom_bam_dmux.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,17 +823,17 @@ static int bam_dmux_probe(struct platform_device *pdev)
823823
ret = devm_request_threaded_irq(dev, pc_ack_irq, NULL, bam_dmux_pc_ack_irq,
824824
IRQF_ONESHOT, NULL, dmux);
825825
if (ret)
826-
return ret;
826+
goto err_disable_pm;
827827

828828
ret = devm_request_threaded_irq(dev, dmux->pc_irq, NULL, bam_dmux_pc_irq,
829829
IRQF_ONESHOT, NULL, dmux);
830830
if (ret)
831-
return ret;
831+
goto err_disable_pm;
832832

833833
ret = irq_get_irqchip_state(dmux->pc_irq, IRQCHIP_STATE_LINE_LEVEL,
834834
&dmux->pc_state);
835835
if (ret)
836-
return ret;
836+
goto err_disable_pm;
837837

838838
/* Check if remote finished initialization before us */
839839
if (dmux->pc_state) {
@@ -844,6 +844,11 @@ static int bam_dmux_probe(struct platform_device *pdev)
844844
}
845845

846846
return 0;
847+
848+
err_disable_pm:
849+
pm_runtime_disable(dev);
850+
pm_runtime_dont_use_autosuspend(dev);
851+
return ret;
847852
}
848853

849854
static void bam_dmux_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)