linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ptp: fix an IS_ERR() vs NULL check
@ 2018-11-30 12:58 Dan Carpenter
  2018-11-30 16:32 ` Richard Cochran
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Carpenter @ 2018-11-30 12:58 UTC (permalink / raw)
  To: Richard Cochran; +Cc: netdev, linux-kernel, kernel-janitors

The pps_register_source() function doesn't return NULL, it returns
error pointers.

Fixes: d94ba80ebbea ("ptp: Added a brand new class driver for ptp clocks.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 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;
 		}
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-12-12 14:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).