You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-apps/ethtool/files/ethtool-5.8-only-memset-non...

21 lines
703 B

https://bugs.gentoo.org/740114
https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=cf12872ebe7d8fac2088e7d2cd5e2a0a5f03499d
--- a/ethtool.c
+++ b/ethtool.c
@@ -3048,10 +3048,11 @@ static int do_sset(struct cmd_context *ctx)
struct ethtool_link_usettings *link_usettings;
link_usettings = do_ioctl_glinksettings(ctx);
- memset(&link_usettings->deprecated, 0,
- sizeof(link_usettings->deprecated));
if (link_usettings == NULL)
link_usettings = do_ioctl_gset(ctx);
+ else
+ memset(&link_usettings->deprecated, 0,
+ sizeof(link_usettings->deprecated));
if (link_usettings == NULL) {
perror("Cannot get current device settings");
err = -1;