From: Julia Lawall <julia.lawall@lip6.fr>
To: Harry Morris <harrymorris12@gmail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
linux-kernel@vger.kernel.org, kbuild-all@01.org
Subject: drivers/net/ieee802154/ca8210.c:918:9-12: ERROR: spi is NULL but dereferenced. (fwd)
Date: Wed, 24 May 2017 09:38:14 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1705240937050.2983@hadrien> (raw)
dev_crit should dereference its first argument, so &spi->dev is not valid
in this place if spi is NULL.
julia
---------- Forwarded message ----------
Date: Wed, 24 May 2017 05:55:09 +0800
From: kbuild test robot <fengguang.wu@intel.com>
To: kbuild@01.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Subject: drivers/net/ieee802154/ca8210.c:918:9-12: ERROR: spi is NULL but
dereferenced.
CC: kbuild-all@01.org
CC: linux-kernel@vger.kernel.org
TO: Harry Morris <harrymorris12@gmail.com>
CC: Marcel Holtmann <marcel@holtmann.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 56fff1bb0f31358bf81a3c64a8dcd6da0dc44263
commit: ded845a781a578dfb0b5b2c138e5a067aa3b1242 ieee802154: Add CA8210 IEEE 802.15.4 device driver
date: 6 weeks ago
:::::: branch date: 5 hours ago
:::::: commit date: 6 weeks ago
>> drivers/net/ieee802154/ca8210.c:918:9-12: ERROR: spi is NULL but dereferenced.
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout ded845a781a578dfb0b5b2c138e5a067aa3b1242
vim +918 drivers/net/ieee802154/ca8210.c
ded845a78 Harry Morris 2017-03-28 902 * @len: length of the buffer being sent
ded845a78 Harry Morris 2017-03-28 903 *
ded845a78 Harry Morris 2017-03-28 904 * Return: 0 or linux error code
ded845a78 Harry Morris 2017-03-28 905 */
ded845a78 Harry Morris 2017-03-28 906 static int ca8210_spi_transfer(
ded845a78 Harry Morris 2017-03-28 907 struct spi_device *spi,
ded845a78 Harry Morris 2017-03-28 908 const u8 *buf,
ded845a78 Harry Morris 2017-03-28 909 size_t len
ded845a78 Harry Morris 2017-03-28 910 )
ded845a78 Harry Morris 2017-03-28 911 {
ded845a78 Harry Morris 2017-03-28 912 int i, status = 0;
ded845a78 Harry Morris 2017-03-28 913 struct ca8210_priv *priv = spi_get_drvdata(spi);
ded845a78 Harry Morris 2017-03-28 914 struct cas_control *cas_ctl;
ded845a78 Harry Morris 2017-03-28 915
ded845a78 Harry Morris 2017-03-28 916 if (!spi) {
ded845a78 Harry Morris 2017-03-28 917 dev_crit(
ded845a78 Harry Morris 2017-03-28 @918 &spi->dev,
ded845a78 Harry Morris 2017-03-28 919 "NULL spi device passed to ca8210_spi_transfer\n"
ded845a78 Harry Morris 2017-03-28 920 );
ded845a78 Harry Morris 2017-03-28 921 return -ENODEV;
ded845a78 Harry Morris 2017-03-28 922 }
ded845a78 Harry Morris 2017-03-28 923
ded845a78 Harry Morris 2017-03-28 924 reinit_completion(&priv->spi_transfer_complete);
ded845a78 Harry Morris 2017-03-28 925
ded845a78 Harry Morris 2017-03-28 926 dev_dbg(&spi->dev, "ca8210_spi_transfer called\n");
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
reply other threads:[~2017-05-24 7:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=alpine.DEB.2.20.1705240937050.2983@hadrien \
--to=julia.lawall@lip6.fr \
--cc=harrymorris12@gmail.com \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.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
all inboxes | Powered by JetHome®