blob: 573ee645615bee1a2e4d076b97ffe1558a68ede9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
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;
|