diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
commit | fc53809803cd2bc2434e312b19a18fa36776da12 (patch) | |
tree | b4b43bd6538f51965ce32856e9c053d0f90919c8 /src/shared/ethtool-util.c | |
parent | Adding upstream version 255.5. (diff) | |
download | systemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip |
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/shared/ethtool-util.c')
-rw-r--r-- | src/shared/ethtool-util.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c index dce9e00..1e100c3 100644 --- a/src/shared/ethtool-util.c +++ b/src/shared/ethtool-util.c @@ -182,7 +182,6 @@ int ethtool_get_driver(int *ethtool_fd, const char *ifname, char **ret) { struct ifreq ifr = { .ifr_data = (void*) &ecmd, }; - char *d; int r; assert(ethtool_fd); @@ -201,12 +200,7 @@ int ethtool_get_driver(int *ethtool_fd, const char *ifname, char **ret) { if (isempty(ecmd.driver)) return -ENODATA; - d = strdup(ecmd.driver); - if (!d) - return -ENOMEM; - - *ret = d; - return 0; + return strdup_to(ret, ecmd.driver); } int ethtool_get_link_info( |