mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl
[ Upstream commit 83d0bdc739 ]
If a gettime64 call fails, return the error and avoid copying data back
to user.
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
49796c3561
commit
ab143302b0
|
|
@ -228,7 +228,9 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
|
|||
pct->sec = ts.tv_sec;
|
||||
pct->nsec = ts.tv_nsec;
|
||||
pct++;
|
||||
ptp->info->gettime64(ptp->info, &ts);
|
||||
err = ptp->info->gettime64(ptp->info, &ts);
|
||||
if (err)
|
||||
goto out;
|
||||
pct->sec = ts.tv_sec;
|
||||
pct->nsec = ts.tv_nsec;
|
||||
pct++;
|
||||
|
|
@ -281,6 +283,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
|
|||
break;
|
||||
}
|
||||
|
||||
out:
|
||||
kfree(sysoff);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user