diff options
| author | Paul Mundt <[email protected]> | 2007-03-05 00:30:31 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2007-03-05 07:57:51 -0800 |
| commit | 1f2b69f9bdce8461341e5fb864568a2ee90079c8 (patch) | |
| tree | cb773297c5e40f0e6ac3b183380140c41700521c /include/linux | |
| parent | 69f7c0a1be84b10a81b6edcce2dbee0cdec26eba (diff) | |
[PATCH] fb: sm501fb off-by-1 sysfs store
Currently sm501fb_crtsrc_store() won't allow the routing to be changed via
echos from userspace in to the sysfs file. The reason for this is that the
strnicmp() for both heads uses a sizeof() for the string length, which ends
up being strlen() + 1 (\0 in the normal case, but the echo gives a newline,
which is where the issue occurs), this then causes a mismatch and
subsequently bails with the -EINVAL.
In addition to this, the hardcoded lengths were then used for the store
length that was returned, which ended up being erroneous and resulting in a
write error. There's also no point in returning anything but the full
length since it will -EINVAL out on a mismatch well before then anyways.
sizeof("string") is great for making sure you have space in your buffer,
but rather less so for string comparisons :-)
Signed-off-by: Paul Mundt <[email protected]>
Acked-by: Ben Dooks <[email protected]>
Cc: "Antonino A. Daplas" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions