[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Y4S5EpZ3JrG0PstH@lunn.ch>
Date: Mon, 28 Nov 2022 14:35:14 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Daniil Tatianin <d-tatianin@...dex-team.ru>
Cc: netdev@...r.kernel.org, Michal Kubecek <mkubecek@...e.cz>,
yc-core@...dex-team.ru, lvc-project@...uxtesting.org
Subject: Re: [PATCH v1 3/3] net/ethtool/ioctl: correct & simplify
ethtool_get_phy_stats if checks
> I guess this does indeed look cleaner although I'm not sure about the
> duplicated n_stats validation code. Maybe this could be moved to a separate
> helper as well or do you think it's okay to duplicate it in this case?
Yes, the validation and the memory allocation could be pulled out into
a helper.
The main thing here is that the code is pretty much identical for the
two functions. If one is correct, the other is also correct. There is
no access in an else branch which can be overlooked.
Andrew
Powered by blists - more mailing lists