public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: dmaengine: add interface of dma_get_slave_channel
Date: Wed, 14 Aug 2013 19:51:20 +0000	[thread overview]
Message-ID: <20130814195120.GA16390@elgon.mountain> (raw)

Hello Zhangfei Gao,

The patch 7bb587f4eef8: "dmaengine: add interface of 
dma_get_slave_channel" from Jun 28, 2013, leads to the following 
warning: "drivers/dma/dmaengine.c:531 dma_get_slave_channel()
	 	error: potential NULL dereference 'chan'."

drivers/dma/dmaengine.c
   516  struct dma_chan *dma_get_slave_channel(struct dma_chan *chan)
   517  {
   518          int err = -EBUSY;
   519  
   520          /* lock against __dma_request_channel */
   521          mutex_lock(&dma_list_mutex);
   522  
   523          if (chan->client_count = 0)
   524                  err = dma_chan_get(chan);
   525          else
   526                  chan = NULL;
                        ^^^^^^^^^^^
   527  
   528          mutex_unlock(&dma_list_mutex);
   529  
   530          if (err)
   531                  pr_debug("%s: failed to get %s: (%d)\n",
   532                          __func__, dma_chan_name(chan), err);
                                                        ^^^^

Dereferenced here.

   533  
   534          return chan;

regards,
dan carpenter


             reply	other threads:[~2013-08-14 19:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 19:51 Dan Carpenter [this message]
2013-08-15  1:29 ` dmaengine: add interface of dma_get_slave_channel zhangfei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130814195120.GA16390@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox