Re: [bug report] dmaengine: stm32-dma: Fix residue computation issue in cyclic mode

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

 



On Wed, Jan 18, 2017 at 04:37:55PM +0100, M'boumba Cedric Madianga wrote:
> >    894  static enum dma_status stm32_dma_tx_status(struct dma_chan *c,
> >    895                                             dma_cookie_t cookie,
> >    896                                             struct dma_tx_state *state)
> >    897  {
> >    898          struct stm32_dma_chan *chan = to_stm32_dma_chan(c);
> >    899          struct virt_dma_desc *vdesc;
> >    900          enum dma_status status;
> >    901          unsigned long flags;
> >    902          u32 residue = 0;
> >    903
> >    904          status = dma_cookie_status(c, cookie, state);
> >    905          if ((status == DMA_COMPLETE) || (!state))
> >    906                  return status;
> >    907
> >    908          spin_lock_irqsave(&chan->vchan.lock, flags);
> >    909          vdesc = vchan_find_desc(&chan->vchan, cookie);
> >    910          if (chan->desc && cookie == chan->desc->vdesc.tx.cookie)
> >                     ^^^^^^^^^^
> > Check for NULL
> >
> >    911                  residue = stm32_dma_desc_residue(chan, chan->desc,
> >    912                                                   chan->next_sg);
> >    913          else if (vdesc)
> >    914                  residue = stm32_dma_desc_residue(chan,
> >                                                          ^^^^
> > Unchecked dereference.
> 
> if vdesc is not NULL, chan->desc could not be NULL because they are
> completely linked.
> 

Just ignore it.  I have an idea how to address these but it will take
probably a year to get to it.

regards,
dan carpenter


--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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