Re: [PATCH net] net: wwan: iosm: Fix error handling path in ipc_pcie_probe()

From: Simon Horman
Date: Sat Apr 08 2023 - 11:33:07 EST


On Fri, Apr 07, 2023 at 11:56:07PM -0700, Harshit Mogalapalli wrote:
> Smatch reports:
> drivers/net/wwan/iosm/iosm_ipc_pcie.c:298 ipc_pcie_probe()
> warn: missing unwind goto?
>
> When dma_set_mask fails it directly returns without disabling pci
> device and freeing ipc_pcie. Fix this my calling a correct goto label
>
> As dma_set_mask returns either 0 or -EIO, we can use a goto label, as
> it finally returns -EIO.
>
> Renamed the goto label as name of the label before this patch is not
> relevant after this patch.

nit: I agree that it's nice to name the labels after what they unwind,
rather than where they are called from. But now both schemes
are used in this function.
>
> Fixes: 035e3befc191 ("net: wwan: iosm: fix driver not working with INTEL_IOMMU disabled")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>
> ---
> This is based on static analysis, only compile tested.

I agree with your analysis.

Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>