On Wed, May 03, 2017 at 10:21:11PM -0700, Stephen Hemminger wrote: >On Wed, 3 May 2017 14:44:35 +1000 >Gavin Shan <gws...@linux.vnet.ibm.com> wrote: > >> +void ncsi_ethtool_register_dev(struct net_device *dev) >> +{ >> + struct ethtool_ops *ops; >> + >> + ops = (struct ethtool_ops *)(dev->ethtool_ops); >> + if (!ops) >> + return; >> + >> + ops->get_ncsi_channels = ncsi_get_channels; >> +} >> + > >Instead of casting away const which opens up potential security >issues. Have two ethtool_ops structures. >
Thanks for the comments, Stephen. Yeah, It should be corrected as Andrew already suggested. Cheers, Gavin