From: Richard Cochran <richardcochran@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ganesh Goudar <ganeshgr@chelsio.com>,
Atul Gupta <atul.gupta@chelsio.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register()
Date: Mon, 10 Jul 2017 11:34:57 +0200 [thread overview]
Message-ID: <20170710093457.xzc5i5zg34z3thjr@localhost.localdomain> (raw)
In-Reply-To: <20170710071137.ui2fhjkqzjqhkopz@mwanda>
On Mon, Jul 10, 2017 at 10:11:37AM +0300, Dan Carpenter wrote:
> The ptp_clock_register() function returns NULL when it's #ifdefed out
> because CONFIG_PTP_1588_CLOCK is disabled. Otherwise, it's intended to
> return error pointers. Unfortunately, there are a couple paths where we
> forget to set the error code. It means that we could result in NULL
> pointer dereferences in the callers.
Actually, this description is bogus. Callers will not dereference
NULL, because they are required to check the returned pointer:
/**
* ptp_clock_register() - register a PTP hardware clock driver
*
* @info: Structure describing the new clock.
* @parent: Pointer to the parent device of the new clock.
*
* Returns a valid pointer on success or PTR_ERR on failure. If PHC
* support is missing at the configuration level, this function
* returns NULL, and drivers are expected to gracefully handle that
* case separately.
*/
Thanks,
Richard
prev parent reply other threads:[~2017-07-10 9:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 7:11 [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register() Dan Carpenter
2017-07-10 7:16 ` [PATCH 2/2 net] cxgb4: ptp_clock_register() returns error pointers Dan Carpenter
2017-07-10 9:56 ` Richard Cochran
2017-07-10 9:21 ` [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register() Richard Cochran
2017-07-10 9:38 ` Dan Carpenter
2017-07-10 9:48 ` Richard Cochran
2017-07-10 10:29 ` Dan Carpenter
2017-07-10 11:02 ` Richard Cochran
2017-07-10 9:34 ` Richard Cochran [this message]
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=20170710093457.xzc5i5zg34z3thjr@localhost.localdomain \
--to=richardcochran@gmail.com \
--cc=atul.gupta@chelsio.com \
--cc=dan.carpenter@oracle.com \
--cc=ganeshgr@chelsio.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@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