[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241230085249.4aa68872@kernel.org>
Date: Mon, 30 Dec 2024 08:52:49 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
Cc: Su Hui <suhui@...china.com>, alexanderduyck@...com,
kernel-team@...a.com, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, horms@...nel.org,
mohsin.bashr@...il.com, sanmanpradhan@...a.com,
kalesh-anakkur.purayil@...adcom.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH v2] eth: fbnic: Avoid garbage value in
fbnic_mac_get_sensor_asic()
On Mon, 30 Dec 2024 09:00:20 +0100 Michal Swiatkowski wrote:
> > @@ -688,23 +688,7 @@ fbnic_mac_get_eth_mac_stats(struct fbnic_dev *fbd, bool reset,
> >
> > static int fbnic_mac_get_sensor_asic(struct fbnic_dev *fbd, int id, long *val)
> > {
> > - struct fbnic_fw_completion fw_cmpl;
> Probably it should be:
> *fw_cmpl = fbd->cmpl_data
> but it is also never initialized.
The other way around, the completion declared on the stack should be
the thing that gets assigned to the pointer in fbd :S
> > - s32 *sensor;
> > -
> > - switch (id) {
> > - case FBNIC_SENSOR_TEMP:
> > - sensor = &fw_cmpl.tsene.millidegrees;
> > - break;
> > - case FBNIC_SENSOR_VOLTAGE:
> > - sensor = &fw_cmpl.tsene.millivolts;
> > - break;
> > - default:
> > - return -EINVAL;
> > - }
> > -
> > - *val = *sensor;
> > -
> > - return 0;
> > + return -EOPNOTSUPP;
>
> It is more like removing broken functionality than fixing (maybe whole
> commit should be reverted). Anyway returning not support is also fine.
I defer to other maintainers. The gaps are trivial to fill in, we'll
do so as soon as this patch makes it to net-next (this patch needs to
target net).
Powered by blists - more mailing lists