[Intel-wired-lan] [PATCH] ice: check the return of ice_ptp_gettimex64

G, GurucharanX gurucharanx.g at intel.com
Fri Feb 18 18:01:51 UTC 2022



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> trix at redhat.com
> Sent: Monday, February 14, 2022 8:03 PM
> To: Brandeburg, Jesse <jesse.brandeburg at intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen at intel.com>; davem at davemloft.net; kuba at kernel.org;
> nathan at kernel.org; ndesaulniers at google.com; Keller, Jacob E
> <jacob.e.keller at intel.com>
> Cc: netdev at vger.kernel.org; llvm at lists.linux.dev; intel-wired-
> lan at lists.osuosl.org; linux-kernel at vger.kernel.org; Tom Rix
> <trix at redhat.com>
> Subject: [Intel-wired-lan] [PATCH] ice: check the return of
> ice_ptp_gettimex64
> 
> From: Tom Rix <trix at redhat.com>
> 
> Clang static analysis reports this issue
> time64.h:69:50: warning: The left operand of '+'
>   is a garbage value
>   set_normalized_timespec64(&ts_delta, lhs.tv_sec + rhs.tv_sec,
>                                        ~~~~~~~~~~ ^ In ice_ptp_adjtime_nonatomic(), the
> timespec64 variable 'now'
> is set by ice_ptp_gettimex64().  This function can fail with -EBUSY, so 'now'
> can have a gargbage value.
> So check the return.
> 
> Fixes: 06c16d89d2cb ("ice: register 1588 PTP clock device object for E810
> devices")
> Signed-off-by: Tom Rix <trix at redhat.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_ptp.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 

Tested-by: Gurucharan G <gurucharanx.g at intel.com> (A Contingent worker at Intel)


More information about the Intel-wired-lan mailing list