From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: bos-Hl0AACgZOF5l57MIdRCFDg@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: re: IB/ipath: sysfs and ipathfs support for core driver
Date: Tue, 8 Jul 2014 13:57:54 +0300 [thread overview]
Message-ID: <20140708105754.GD19737@mwanda> (raw)
Hello Bryan O'Sullivan,
This is a semi-automatic email about new static checker warnings.
The patch 3e9b4a5eb4ae: "IB/ipath: sysfs and ipathfs support for core
driver" from Mar 29, 2006, leads to the following Smatch complaint:
drivers/infiniband/hw/ipath/ipath_fs.c:285 remove_file()
error: we previously assumed 'tmp->d_inode' could be null (see line 281)
drivers/infiniband/hw/ipath/ipath_fs.c
280 spin_lock(&tmp->d_lock);
281 if (!(d_unhashed(tmp) && tmp->d_inode)) {
^^^^^^^^^^^^
We allow that ->d_inode to be NULL.
282 dget_dlock(tmp);
283 __d_drop(tmp);
284 spin_unlock(&tmp->d_lock);
285 simple_unlink(parent->d_inode, tmp);
^^^
But we dereference it inside the call to simple_unlink(). This code is
probably cut-and-pasted from configfs because I reported a bug in that
code as well yesterday but haven't heard back.
286 } else
287 spin_unlock(&tmp->d_lock);
drivers/infiniband/hw/qib/qib_fs.c
458 spin_lock(&tmp->d_lock);
459 if (!(d_unhashed(tmp) && tmp->d_inode)) {
^^^^^^^^^^^^
460 __d_drop(tmp);
461 spin_unlock(&tmp->d_lock);
462 simple_unlink(parent->d_inode, tmp);
^^^
And another one here in qib_fs.c.
463 } else {
464 spin_unlock(&tmp->d_lock);
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
reply other threads:[~2014-07-08 10:57 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=20140708105754.GD19737@mwanda \
--to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=bos-Hl0AACgZOF5l57MIdRCFDg@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.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