re: dma: Add Freescale eDMA engine driver support

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

 



Hello Jingchang Lu,

The patch d6be34fbd39b: "dma: Add Freescale eDMA engine driver
support" from Feb 18, 2014, leads to the following static checker
warning:

	drivers/dma/fsl-edma.c:732 fsl_edma_xlate()
	error: we previously assumed 'chan' could be null (see line 737)

drivers/dma/fsl-edma.c
   731          mutex_lock(&fsl_edma->fsl_edma_mutex);
   732          list_for_each_entry(chan, &fsl_edma->dma_dev.channels, device_node) {
                ^^^^^^^^^^^^^^^^^^^
This will have a NULL dereference if ...

   733                  if (chan->client_count)
   734                          continue;
   735                  if ((chan->chan_id / DMAMUX_NR) == dma_spec->args[0]) {
   736                          chan = dma_get_slave_channel(chan);
   737                          if (chan) {
                                    ^^^^
... if "chan" is NULL here.

   738                                  chan->device->privatecnt++;
   739                                  fsl_edma_chan_mux(to_fsl_edma_chan(chan),
   740                                          dma_spec->args[1], true);
   741                                  mutex_unlock(&fsl_edma->fsl_edma_mutex);
   742                                  return chan;
   743                          }
   744                  }
   745          }
   746          mutex_unlock(&fsl_edma->fsl_edma_mutex);
   747          return NULL;

It's most likely that list_for_each_entry_safe() was intended instead
of list_for_each_entry() but I'm not sure about this enough to make the
change myself.

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