From: YueHaibing <yuehaibing@huawei.com>
To: <olteanv@gmail.com>, <andrew@lunn.ch>, <vivien.didelot@gmail.com>,
<f.fainelli@gmail.com>, <davem@davemloft.net>, <kuba@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH] net: dsa: sja1105: Fix return value check in sja1105_ptp_clock_register()
Date: Thu, 12 Nov 2020 22:55:32 +0800 [thread overview]
Message-ID: <20201112145532.38320-1-yuehaibing@huawei.com> (raw)
drivers/net/dsa/sja1105/sja1105_ptp.c:869 sja1105_ptp_clock_register() warn: passing zero to 'PTR_ERR'
ptp_clock_register() returns ERR_PTR() and never returns
NULL. The NULL test should be removed.
Fixes: bb77f36ac21d ("net: dsa: sja1105: Add support for the PTP clock")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/net/dsa/sja1105/sja1105_ptp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/sja1105/sja1105_ptp.c b/drivers/net/dsa/sja1105/sja1105_ptp.c
index 1b90570b257b..1e41d491c854 100644
--- a/drivers/net/dsa/sja1105/sja1105_ptp.c
+++ b/drivers/net/dsa/sja1105/sja1105_ptp.c
@@ -865,7 +865,7 @@ int sja1105_ptp_clock_register(struct dsa_switch *ds)
spin_lock_init(&tagger_data->meta_lock);
ptp_data->clock = ptp_clock_register(&ptp_data->caps, ds->dev);
- if (IS_ERR_OR_NULL(ptp_data->clock))
+ if (IS_ERR(ptp_data->clock))
return PTR_ERR(ptp_data->clock);
ptp_data->cmd.corrclk4ts = true;
--
2.17.1
next reply other threads:[~2020-11-12 14:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 14:55 YueHaibing [this message]
2020-11-13 7:10 ` [PATCH] net: dsa: sja1105: Fix return value check in sja1105_ptp_clock_register() Kurt Kanzenbach
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=20201112145532.38320-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@gmail.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).