Re: dmaengine: pl08x: Split device_control

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

 



Hi Dan

On Tue, Jan 06, 2015 at 10:04:15PM +0300, Dan Carpenter wrote:
> Hello Maxime Ripard,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch bcd1b0b9015b: "dmaengine: pl08x: Split device_control" from 
> Nov 17, 2014, leads to the following Smatch complaint:
> 
> drivers/dma/amba-pl08x.c:1745 pl08x_pause()
> 	 error: we previously assumed 'plchan->phychan' could be null (see line 1740)
> 
> drivers/dma/amba-pl08x.c
>   1739		spin_lock_irqsave(&plchan->vc.lock, flags);
>   1740		if (!plchan->phychan && !plchan->at) {
>                      ^^^^^^^^^^^^^^^
> Old test.  Maybe the && should be ||?
> 
>   1741			spin_unlock_irqrestore(&plchan->vc.lock, flags);
>   1742			return 0;
>   1743		}
>   1744	
>   1745		pl08x_pause_phy_chan(plchan->phychan);
>                                      ^^^^^^^^^^^^^^^
> New dereference inside the call to pl08x_pause_phy_chan()
> 
>   1746		plchan->state = PL08X_CHAN_PAUSED;
>   1747	
> 
> See also:
> drivers/dma/amba-pl08x.c:412 pl08x_start_next_txd() warn: this loop depends on readl() succeeding
> 	(readl() return (uint)-1 on failure/hotplug).
> drivers/dma/amba-pl08x.c:1359 pl08x_burst() error: buffer overflow 'burst_sizes' 8 <= 8
> drivers/dma/amba-pl08x.c:1745 pl08x_pause() error: we previously assumed 'plchan->phychan' could be null (see line 1740)
> drivers/dma/amba-pl08x.c:1768 pl08x_resume() error: we previously assumed 'plchan->phychan' could be null (see line 1763)

I don't really know what to do here, I just moved things around in
this driver. Linus?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

Attachment: signature.asc
Description: Digital 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 PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux