> -----Original Message-----
> From: Nguyen, Anthony L <anthony.l.ngu...@intel.com>
> Sent: Thursday, August 15, 2024 3:17 PM
> To: Polchlopek, Mateusz <mateusz.polchlo...@intel.com>; intel-wired-
> l...@lists.osuosl.org; Lobakin, Aleksander <aleksander.loba...@intel.com>
> Cc: net...@vger.kernel.org; Keller, Jacob E <jacob.e.kel...@intel.com>; 
> Drewek,
> Wojciech <wojciech.dre...@intel.com>; Sai Krishna <saikrish...@marvell.com>;
> Simon Horman <ho...@kernel.org>; Zaki, Ahmed <ahmed.z...@intel.com>
> Subject: Re: [Intel-wired-lan] [PATCH iwl-next v9 06/14] iavf: add initial 
> framework
> for registering PTP clock
> 
> 
> 
> On 8/13/2024 5:55 AM, Mateusz Polchlopek wrote:
> > From: Jacob Keller <jacob.e.kel...@intel.com>
> 
> ...
> 
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_ptp.c
> b/drivers/net/ethernet/intel/iavf/iavf_ptp.c
> 
> ...
> 
> > +static int iavf_ptp_register_clock(struct iavf_adapter *adapter)
> > +{
> > +   struct ptp_clock_info *ptp_info = &adapter->ptp.info;
> > +   struct device *dev = &adapter->pdev->dev;
> > +
> > +   memset(ptp_info, 0, sizeof(*ptp_info));
> > +
> > +   snprintf(ptp_info->name, sizeof(ptp_info->name), "%s-%s-clk",
> > +            dev_driver_string(dev), dev_name(dev));
> > +   ptp_info->owner = THIS_MODULE;
> > +
> > +   adapter->ptp.clock = ptp_clock_register(ptp_info, dev);
> > +   if (IS_ERR(adapter->ptp.clock)) {
> > +           adapter->ptp.clock = NULL;
> > +
> > +           return PTR_ERR(adapter->ptp.clock);
> > +   }
> 
> cocci reports:
> +drivers/net/ethernet/intel/iavf/iavf_ptp.c:47:9-16: ERROR: PTR_ERR
> applied after initialization to constant on line 45

Ya, shouldn't this be returning the original error value like:

err = PTR_ERR(adapter->ptp.clock);
adapter->ptp.clock = NULL
return err;

or something along those lines.

Reply via email to