All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/mailbox/arm_mhuv2.c:702 mhuv2_receiver_interrupt() error: 'data' dereferencing possible ERR_PTR()
Date: Mon, 22 Feb 2021 03:46:00 +0800	[thread overview]
Message-ID: <202102220358.aOPcTt3U-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3387 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Viresh Kumar <viresh.kumar@linaro.org>
CC: Jassi Brar <jaswinder.singh@linaro.org>
CC: Tushar Khandelwal <tushar.khandelwal@arm.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   55f62bc873477dae2c45bbbc30b86cf3e0982f3b
commit: 5a6338cce9f4133c478d3b10b300f96dd644379a mailbox: arm_mhuv2: Add driver
date:   2 months ago
:::::: branch date: 14 hours ago
:::::: commit date: 2 months ago
config: arm64-randconfig-m031-20210221 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/mailbox/arm_mhuv2.c:702 mhuv2_receiver_interrupt() error: 'data' dereferencing possible ERR_PTR()

vim +/data +702 drivers/mailbox/arm_mhuv2.c

5a6338cce9f413 Viresh Kumar 2020-11-17  673  
5a6338cce9f413 Viresh Kumar 2020-11-17  674  static irqreturn_t mhuv2_receiver_interrupt(int irq, void *arg)
5a6338cce9f413 Viresh Kumar 2020-11-17  675  {
5a6338cce9f413 Viresh Kumar 2020-11-17  676  	struct mhuv2 *mhu = arg;
5a6338cce9f413 Viresh Kumar 2020-11-17  677  	struct mbox_chan *chan = get_irq_chan_rx(mhu);
5a6338cce9f413 Viresh Kumar 2020-11-17  678  	struct device *dev = mhu->mbox.dev;
5a6338cce9f413 Viresh Kumar 2020-11-17  679  	struct mhuv2_mbox_chan_priv *priv;
5a6338cce9f413 Viresh Kumar 2020-11-17  680  	int ret = IRQ_NONE;
5a6338cce9f413 Viresh Kumar 2020-11-17  681  	void *data;
5a6338cce9f413 Viresh Kumar 2020-11-17  682  
5a6338cce9f413 Viresh Kumar 2020-11-17  683  	if (IS_ERR(chan)) {
5a6338cce9f413 Viresh Kumar 2020-11-17  684  		dev_warn(dev, "Failed to find channel for the rx interrupt\n");
5a6338cce9f413 Viresh Kumar 2020-11-17  685  		return IRQ_NONE;
5a6338cce9f413 Viresh Kumar 2020-11-17  686  	}
5a6338cce9f413 Viresh Kumar 2020-11-17  687  	priv = chan->con_priv;
5a6338cce9f413 Viresh Kumar 2020-11-17  688  
5a6338cce9f413 Viresh Kumar 2020-11-17  689  	/* Read and clear the data first */
5a6338cce9f413 Viresh Kumar 2020-11-17  690  	data = priv->ops->read_data(mhu, chan);
5a6338cce9f413 Viresh Kumar 2020-11-17  691  
5a6338cce9f413 Viresh Kumar 2020-11-17  692  	if (!chan->cl) {
5a6338cce9f413 Viresh Kumar 2020-11-17  693  		dev_warn(dev, "Received data on channel (%u) not currently attached to a mailbox client\n",
5a6338cce9f413 Viresh Kumar 2020-11-17  694  			 priv->ch_wn_idx);
5a6338cce9f413 Viresh Kumar 2020-11-17  695  	} else if (IS_ERR(data)) {
5a6338cce9f413 Viresh Kumar 2020-11-17  696  		dev_err(dev, "Failed to read data: %lu\n", PTR_ERR(data));
5a6338cce9f413 Viresh Kumar 2020-11-17  697  	} else {
5a6338cce9f413 Viresh Kumar 2020-11-17  698  		mbox_chan_received_data(chan, data);
5a6338cce9f413 Viresh Kumar 2020-11-17  699  		ret = IRQ_HANDLED;
5a6338cce9f413 Viresh Kumar 2020-11-17  700  	}
5a6338cce9f413 Viresh Kumar 2020-11-17  701  
5a6338cce9f413 Viresh Kumar 2020-11-17 @702  	kfree(data);
5a6338cce9f413 Viresh Kumar 2020-11-17  703  	return ret;
5a6338cce9f413 Viresh Kumar 2020-11-17  704  }
5a6338cce9f413 Viresh Kumar 2020-11-17  705  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 27144 bytes --]

             reply	other threads:[~2021-02-21 19:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21 19:46 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-02-22  6:24 drivers/mailbox/arm_mhuv2.c:702 mhuv2_receiver_interrupt() error: 'data' dereferencing possible ERR_PTR() Dan Carpenter
2021-02-22  6:24 ` Dan Carpenter
2021-02-22  6:24 ` Dan Carpenter

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=202102220358.aOPcTt3U-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.