summaryrefslogtreecommitdiff
path: root/drivers/pps/clients/pps-ldisc.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-11-26 18:24:22 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-27 10:05:36 +0100
commit3b1ad360acad6052c2568f891bb3d0f3f057016f (patch)
treede4291619d8337d97483536676c2938931948c97 /drivers/pps/clients/pps-ldisc.c
parenteb30abeedee76c04bdf41c6d88545472c11a5632 (diff)
pps: using ERR_PTR instead of NULL while pps_register_source fails
pps_register_source() has keeps error codes in a local variable, but it does not make use of the code. This patch let it return the errcode in case of failure. Suggested-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Rodolfo Giometti <giometti@enneenne.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pps/clients/pps-ldisc.c')
-rw-r--r--drivers/pps/clients/pps-ldisc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pps/clients/pps-ldisc.c b/drivers/pps/clients/pps-ldisc.c
index 73bd3bb4d93b..00f6c460e493 100644
--- a/drivers/pps/clients/pps-ldisc.c
+++ b/drivers/pps/clients/pps-ldisc.c
@@ -72,9 +72,9 @@ static int pps_tty_open(struct tty_struct *tty)
pps = pps_register_source(&info, PPS_CAPTUREBOTH | \
PPS_OFFSETASSERT | PPS_OFFSETCLEAR);
- if (pps == NULL) {
+ if (IS_ERR(pps)) {
pr_err("cannot register PPS source \"%s\"\n", info.path);
- return -ENOMEM;
+ return PTR_ERR(pps);
}
pps->lookup_cookie = tty;