[bug report] dmaengine: owl: Add Slave and Cyclic mode support for Actions Semi Owl S900 SoC

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

 



Hello Manivannan Sadhasivam,

Commit d64e1b3f5cce ("dmaengine: owl: Add Slave and Cyclic mode
support for Actions Semi Owl S900 SoC") from Sep 29, 2018
(linux-next), leads to the following Smatch static checker warning:

	drivers/dma/owl-dma.c:764 owl_dma_resume()
	error: we previously assumed 'vchan->pchan' could be null (see line 757)

drivers/dma/owl-dma.c
    752 static int owl_dma_resume(struct dma_chan *chan)
    753 {
    754         struct owl_dma_vchan *vchan = to_owl_vchan(chan);
    755         unsigned long flags;
    756 
    757         if (!vchan->pchan && !vchan->txd)

Presumably this should be || instead of &&?

    758                 return 0;
    759 
    760         dev_dbg(chan2dev(chan), "vchan %p: resume\n", &vchan->vc);
    761 
    762         spin_lock_irqsave(&vchan->vc.lock, flags);
    763 
--> 764         owl_dma_resume_pchan(vchan->pchan);
                                     ^^^^^^^^^^^^
If only ->pchan is NULL then it will crash here.

    765 
    766         spin_unlock_irqrestore(&vchan->vc.lock, flags);
    767 
    768         return 0;
    769 }

regards,
dan carpenter




[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