Re: [PATCH 1/1] spi: fix use after free in of_spi_notify

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

 



On Tue, Jun 07, 2022 at 11:52:33PM +0800, Xiaohui Zhang wrote:
> We can't use "ctlr->dev" after it has been freed.

>  		spi = of_register_spi_device(ctlr, rd->dn);
> -		put_device(&ctlr->dev);
>  
>  		if (IS_ERR(spi)) {
>  			pr_err("%s: failed to create for '%pOF'\n",
>  					__func__, rd->dn);
> +			put_device(&ctlr->dev);
>  			of_node_clear_flag(rd->dn, OF_POPULATED);
>  			return notifier_from_errno(PTR_ERR(spi));
>  		}
> +		put_device(&ctlr->dev);
>  		break;

Could you be more explicit about where the problematic use of ctlr->dev
is please?

Attachment: signature.asc
Description: PGP signature


[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