Re: [PATCH -next 3/6] spi: omap-uwire: Switch to use devm_spi_alloc_master()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 20, 2022 at 09:48:16PM +0800, Yang Yingliang wrote:
> @@ -476,7 +474,6 @@ static int uwire_probe(struct platform_device *pdev)
>  	if (IS_ERR(uwire->ck)) {
>  		status = PTR_ERR(uwire->ck);
>  		dev_dbg(&pdev->dev, "no functional clock?\n");
> -		spi_master_put(master);
>  		return status;
>  	}
>  	clk_prepare_enable(uwire->ck);

Change this hunk to return PTR_ERR(uwire->ck) directly without
assigning to status first.

> @@ -518,6 +515,7 @@ static int uwire_remove(struct platform_device *pdev)
>  
>  	spi_bitbang_stop(&uwire->bitbang);
>  	uwire_off(uwire);
> +	spi_master_put(uwire->bitbang.master);
>  	return 0;
>  }
>  

No, drop this hunk, it results in a use-after-free.

Thanks,

Lukas



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux