re: dmaengine: core: Use dev_ functions for debug and error prints

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

 



Hello Jarkko Nikula,

The patch ef859312c3a1: "dmaengine: core: Use dev_ functions for
debug and error prints" from Mar 14, 2016, leads to the following
static checker warning:

	drivers/dma/dmaengine.c:667 __dma_request_channel()
	error: potential NULL dereference 'chan'.

drivers/dma/dmaengine.c
   650  struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
   651                                         dma_filter_fn fn, void *fn_param)
   652  {
   653          struct dma_device *device, *_d;
   654          struct dma_chan *chan = NULL;
                                 ^^^^^^^^^^^
   655  
   656          /* Find a channel */
   657          mutex_lock(&dma_list_mutex);
   658          list_for_each_entry_safe(device, _d, &dma_device_list, global_node) {
   659                  chan = find_candidate(device, mask, fn, fn_param);
   660                  if (!IS_ERR(chan))
   661                          break;
   662  
   663                  chan = NULL;
                        ^^^^^^^^^^^^
   664          }
   665          mutex_unlock(&dma_list_mutex);
   666  
   667          dev_dbg(chan->device->dev, "%s: %s (%s)\n",
                        ^^^^^^^^^^^^^^^^^
Potential NULL dereference.

   668                   __func__,
   669                   chan ? "success" : "fail",
   670                   chan ? dma_chan_name(chan) : NULL);
   671  
   672          return chan;
   673  }

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