]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-builtin-net_id: use EINVAL when we get unexpected sysattr value
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 13 Mar 2026 20:40:14 +0000 (05:40 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 May 2026 17:55:56 +0000 (02:55 +0900)
The results are completely ignored or only checked if it is negative or
not. Hence, this does not change anything.

src/udev/udev-builtin-net_id.c

index bbf719bba59a2dfc09a9a09b13e146230aa3e887..1f04075723e2f98978688427f4708d8fa15bd965 100644 (file)
@@ -249,7 +249,7 @@ static int pci_get_onboard_index(sd_device *dev, unsigned *ret) {
                 return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL),
                                               "Naming scheme does not allow onboard index==0.");
         if (!is_valid_onboard_index(idx))
-                return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ENOENT),
+                return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL),
                                               "Not a valid onboard index: %u", idx);
 
         *ret = idx;
@@ -767,7 +767,7 @@ static int names_platform(UdevEvent *event, const char *prefix) {
                 return -EOPNOTSUPP;
 
         if (!in_charset(vendor, validchars))
-                return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ENOENT),
+                return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL),
                                               "Platform vendor contains invalid characters: %s", vendor);
 
         ascii_strlower(vendor);