The assertion can be triggered by bad `$attr{[<subsys>/<sysname>]<attribute>}`
formatting. That's not a programmer's error, but a runtime error.
Prompted by #30029.
int r;
assert_return(ret, -EINVAL);
- assert_return(path_is_normalized(subsystem), -EINVAL);
- assert_return(path_is_normalized(sysname), -EINVAL);
+ assert_return(subsystem, -EINVAL);
+ assert_return(sysname, -EINVAL);
+
+ if (!path_is_normalized(subsystem))
+ return -EINVAL;
+ if (!path_is_normalized(sysname))
+ return -EINVAL;
/* translate sysname back to sysfs filename */
name = strdupa_safe(sysname);