FYI, the right fix for sysfs would be to simply offer a new variant of ->show using the seq_file infrastructure. That will take care of all the bounds checking in a maintainable and well understood way.
FYI, the right fix for sysfs would be to simply offer a new variant of ->show using the seq_file infrastructure. That will take care of all the bounds checking in a maintainable and well understood way.