ptp: fix an IS_ERR() vs NULL check
We recently modified pps_register_source() to return error pointers
instead of NULL but it seems like there was a merge issue and part of
the commit was lost. Anyway, the ptp_clock_register() function needs to
be updated to check for IS_ERR() as well.
Fixes: 3b1ad360ac
("pps: using ERR_PTR instead of NULL while pps_register_source fails")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
fdd6696846
Коммит
b9d93594c7
|
@ -260,7 +260,8 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
|
||||||
pps.mode = PTP_PPS_MODE;
|
pps.mode = PTP_PPS_MODE;
|
||||||
pps.owner = info->owner;
|
pps.owner = info->owner;
|
||||||
ptp->pps_source = pps_register_source(&pps, PTP_PPS_DEFAULTS);
|
ptp->pps_source = pps_register_source(&pps, PTP_PPS_DEFAULTS);
|
||||||
if (!ptp->pps_source) {
|
if (IS_ERR(ptp->pps_source)) {
|
||||||
|
err = PTR_ERR(ptp->pps_source);
|
||||||
pr_err("failed to register pps source\n");
|
pr_err("failed to register pps source\n");
|
||||||
goto no_pps;
|
goto no_pps;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче