ethtool: make ethtool_get_driver() return -ENODATA if ioctl succeeds but driver name is empty
Inspired by #17532.
This commit is contained in:
parent
a93187ced5
commit
861de64e68
|
@ -197,6 +197,9 @@ int ethtool_get_driver(int *ethtool_fd, const char *ifname, char **ret) {
|
|||
if (r < 0)
|
||||
return -errno;
|
||||
|
||||
if (isempty(ecmd.driver))
|
||||
return -ENODATA;
|
||||
|
||||
d = strdup(ecmd.driver);
|
||||
if (!d)
|
||||
return -ENOMEM;
|
||||
|
|
Loading…
Reference in New Issue