From: Dan Carpenter <dan.carpenter@oracle.com>
To: Richard Cochran <richardcochran@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org,
YueHaibing <yuehaibing@huawei.com>
Subject: Re: [PATCH v2] ptp: fix an IS_ERR() vs NULL check
Date: Tue, 4 Dec 2018 10:00:33 +0300 [thread overview]
Message-ID: <20181204070033.GG3073@unbuntlaptop> (raw)
In-Reply-To: <20181204044257.grk3na2wyrx6nssg@localhost>
Hi Greg,
I meant to CC you but I screwed up and added you to the From header
instead... :(
Why did you commit 3b1ad360acad ("pps: using ERR_PTR instead of NULL
while pps_register_source fails")? You're not listed as a maintainer so
I wouldn't have known to CC you.
The back story is that the last chunk which changes drivers/ptp/ptp_clock.c
was dropped by mistake and it's not there in linux-next. I wrote a
patch which adds it, but everyone is super confused now... Here is
YueHaibing's original patch btw, for reference.
https://www.spinics.net/lists/netdev/msg535929.html
regards,
dan carpenter
On Mon, Dec 03, 2018 at 08:42:57PM -0800, Richard Cochran wrote:
> On Mon, Dec 03, 2018 at 01:55:06PM +0300, Dan Carpenter wrote:
> > We recently modified pps_register_source() to return error pointers
> > instead of NULL but this check wasn't updated.
>
> But it *was* updated!
>
> > Fixes: 3b1ad360acad ("pps: using ERR_PTR instead of NULL while pps_register_source fails")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > v2: Use the correct Fixes tag. Add Greg to the CC list, because he
> > is maintaining this driver.
>
> What driver? (I am maintaining drivers/ptp/ptp_clock.c)
>
> > drivers/ptp/ptp_clock.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
> > index 8a81eecc0ecd..48f3594a7458 100644
> > --- a/drivers/ptp/ptp_clock.c
> > +++ b/drivers/ptp/ptp_clock.c
> > @@ -265,8 +265,8 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
> > pps.mode = PTP_PPS_MODE;
> > pps.owner = info->owner;
> > ptp->pps_source = pps_register_source(&pps, PTP_PPS_DEFAULTS);
> > - if (!ptp->pps_source) {
> > - err = -EINVAL;
> > + if (IS_ERR(ptp->pps_source)) {
> > + err = PTR_ERR(ptp->pps_source);
> > pr_err("failed to register pps source\n");
> > goto no_pps;
> > }
>
> YueHaibing's patch has the following hunk. It really is already
> there. I don't see it yet on Linus' master branch, but the patch
> should update drivers/pps/kapi.c and the callers all in one commit.
>
> diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
> index 8a81eec..48f3594 100644
> --- a/drivers/ptp/ptp_clock.c
> +++ b/drivers/ptp/ptp_clock.c
> @@ -265,8 +265,8 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
> pps.mode = PTP_PPS_MODE;
> pps.owner = info->owner;
> ptp->pps_source = pps_register_source(&pps, PTP_PPS_DEFAULTS);
> - if (!ptp->pps_source) {
> - err = -EINVAL;
> + if (IS_ERR(ptp->pps_source)) {
> + err = PTR_ERR(ptp->pps_source);
> pr_err("failed to register pps source\n");
> goto no_pps;
> }
>
> Thanks,
> Richard
next prev parent reply other threads:[~2018-12-04 7:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-30 12:58 [PATCH] ptp: fix an IS_ERR() vs NULL check Dan Carpenter
2018-11-30 16:32 ` Richard Cochran
2018-12-03 10:04 ` Dan Carpenter
[not found] ` <20181203105506.GA21127@unbuntlaptop>
2018-12-04 4:42 ` [PATCH v2] " Richard Cochran
2018-12-04 7:00 ` Dan Carpenter [this message]
2018-12-04 10:54 ` Greg Kroah-Hartman
2018-12-04 14:55 ` Richard Cochran
2018-12-04 15:10 ` Dan Carpenter
2018-12-06 12:38 ` Richard Cochran
2018-12-06 13:57 ` Greg Kroah-Hartman
2018-12-07 6:00 ` [PATCH v3] " Dan Carpenter
2018-12-12 14:17 ` Richard Cochran
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=20181204070033.GG3073@unbuntlaptop \
--to=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=yuehaibing@huawei.com \
/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).