lib: Handle empty saved configuration values
Empty string module parameters return EOF on kernels prior to 4.14
commit 96802e6b1dbf ("kernel/params.c: fix an overflow in
param_attr_show"), causing fw_load02 to abort with TBROK on v4.4.
Accept empty values while retaining read-error handling and the original
errno. Restore empty strings with a NUL byte: an empty write does not
invoke the sysfs setter, while a newline would change the saved value.
Reviewed-by: Cyril Hrubis <[email protected]>
Reviewed-by: Petr Vorel <[email protected]>
Reviewed-by: Martin Doucha <[email protected]>
Tested-by: Martin Doucha <[email protected]>
Signed-off-by: Andrea Cervesato <[email protected]>
1 file changed