Fix input modalias sysfs attribute return size
PATCH 1/1 Fix input modalias sysfs attribute return size
When writing some udev rules using the input system's modalias attribute, udevinfo showed it as being ignored. Debugging revealed the 52 character string was over 128 bytes long according to udev (and hence ignored).
The problem appears to be in the kernel where a max_t in input.c should really be a min_t.
Signed-off-by Richard Purdie <[email protected]>
drivers/input/input.c +1 -1
@@ -629,7 +629,7 @@ len =input_print_modalias (buf,PAGE_SIZE , id,1 ); -return max_t (int, len,PAGE_SIZE ); +return min_t (int, len,PAGE_SIZE ); } static CLASS_DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL);
Quoted 8 lines · Richard Purdie
When writing some udev rules using the input system's modalias attribute, udevinfo showed it as being ignored. Debugging revealed the 52 character string was over 128 bytes long according to udev (and hence ignored).
The problem appears to be in the kernel where a
max_tininput.cshould really be amin_t.
Applied to my tree, Linus should pull shortly. Thank you Richard.
Signature · 1 line
Dmitry