Re: [PATCH v2 12/20] staging: mt7621-pci: rewrite pcie phy related functions

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

 



On Sun, Aug 12, 2018 at 08:45:57PM +0200, Sergio Paracuellos wrote:
> @@ -561,15 +660,13 @@ static int mt7621_pci_probe(struct platform_device *pdev)
>  
>  	mdelay(100);
>  
> -	list_for_each_entry_safe(port, tmp, &pcie->ports, list)
> -		mt7621_pcie_enable_port(port);
> -
> -	if ((*(unsigned int *)(0xbe00000c)&0xFFFF) == 0x0101) // MT7621 E2
> -		bypass_pipe_rst(pcie);
> -	set_phy_for_ssc(pcie);
> -
>  	list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
>  		u32 slot = port->slot;
> +
> +		mt7621_pcie_enable_port(port);
> +		if ((*(unsigned int *)(0xbe00000c)&0xFFFF) == 0x0101) // MT7621 E2
> +			bypass_pipe_rst(port);
> +		set_phy_for_ssc(port);
                                ^^^^
This is a use after free.  Bugs like this are why we discourage layering
violations.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux