linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: YE Chengfeng <cyeaa@connect.ust.hk>
To: "heikki.krogerus@linux.intel.com"
	<heikki.krogerus@linux.intel.com>,
	"andriy.shevchenko@linux.intel.com" 
	<andriy.shevchenko@linux.intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: suspected null-pointer-reference problem for to_swnode
Date: Mon, 25 Oct 2021 14:03:51 +0000	[thread overview]
Message-ID: <TYCP286MB11888DAE6D94FAE6A9F1CB438A839@TYCP286MB1188.JPNP286.PROD.OUTLOOK.COM> (raw)

Hi, 

https://github.com/torvalds/linux/blob/master/drivers/base/swnode.c#L405

We notice that the return pointer of to_swnode is null check in some case, while in some case is not. For example, at line 416, the return pointer is null-check, but in line 405 is not. We want to know whether it would be a potential null pointer dereference problem, in the case that null-check is missing.

This problem is detected by our experimental static analysis tool, we are not familiar with the source code and it could just be a false positive. We send this email in case this is a real problem. Would you like to spare some time to have a look at it?

Thanks so much,
Chengfeng

             reply	other threads:[~2021-10-25 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 14:03 YE Chengfeng [this message]
2021-10-25 16:40 ` suspected null-pointer-reference problem for to_swnode andriy.shevchenko
2021-10-26 10:12   ` 回复: " YE Chengfeng
2021-10-26 15:11   ` Sakari Ailus
2021-10-26 16:33     ` andriy.shevchenko

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=TYCP286MB11888DAE6D94FAE6A9F1CB438A839@TYCP286MB1188.JPNP286.PROD.OUTLOOK.COM \
    --to=cyeaa@connect.ust.hk \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).