Paul Mundt
1f2b69f9bd
[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 <lethal@linux-sh.org >
Acked-by: Ben Dooks <ben-linux@fluff.org >
Cc: "Antonino A. Daplas" <adaplas@pol.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2007-03-05 07:57:51 -08:00
..
2007-03-02 15:22:54 -08:00
2007-02-20 09:26:54 +00:00
2007-02-20 08:38:45 +00:00
2007-02-12 09:48:42 -08:00
2007-02-20 17:10:16 -08:00
2007-02-14 08:09:54 -08:00
2007-02-14 08:09:54 -08:00
2006-06-30 19:25:36 +02:00
2007-02-13 22:09:03 +01:00
2007-02-12 09:48:45 -08:00
2007-02-20 09:26:53 +00:00
2006-11-16 11:43:37 -08:00
2007-02-20 09:26:53 +00:00
2007-02-14 08:09:54 -08:00
2007-02-12 09:48:42 -08:00
2006-07-10 13:24:16 -07:00
2006-06-30 19:25:36 +02:00
2005-04-16 15:20:36 -07:00
2006-12-13 09:05:58 -08:00
2006-12-13 09:05:55 -08:00
2006-12-08 08:28:50 -08:00
2006-07-10 13:24:16 -07:00
2007-02-14 08:09:54 -08:00
2007-02-12 09:48:43 -08:00
2006-12-08 08:29:06 -08:00
2006-10-05 15:10:12 +01:00
2006-03-27 08:44:55 -08:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2006-12-31 14:06:05 -08:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2006-06-30 19:25:36 +02:00
2006-06-30 19:25:36 +02:00
2006-12-08 08:29:05 -08:00
2006-12-31 14:06:05 -08:00
2006-12-31 14:06:05 -08:00
2006-12-31 14:06:05 -08:00
2007-02-20 09:26:53 +00:00
2006-12-08 08:29:05 -08:00
2005-11-07 07:53:50 -08:00
2007-02-12 09:48:43 -08:00
2005-04-16 15:20:36 -07:00
2007-02-12 09:48:42 -08:00
2006-06-30 19:25:36 +02:00
2006-06-30 19:25:36 +02:00
2006-07-10 13:24:16 -07:00
2005-04-16 15:20:36 -07:00
2006-12-08 08:28:50 -08:00
2006-11-16 22:18:28 -08:00
2006-07-31 13:28:44 -07:00
2006-12-08 08:29:05 -08:00
2006-12-08 08:29:05 -08:00
2007-02-14 08:09:54 -08:00
2006-12-08 08:29:05 -08:00
2007-02-20 08:38:46 +00:00
2006-12-31 14:06:05 -08:00
2006-12-08 08:29:04 -08:00
2007-02-14 08:09:54 -08:00
2006-06-30 19:25:36 +02:00
2006-12-22 08:55:50 -08:00
2006-07-10 13:24:16 -07:00
2007-02-14 08:09:54 -08:00
2007-02-14 08:09:54 -08:00
2007-02-12 09:48:43 -08:00
2006-08-27 11:01:29 -07:00
2006-07-10 13:24:16 -07:00
2007-02-14 08:09:54 -08:00
2005-07-17 20:15:36 +01:00
2007-03-01 14:53:38 -08:00
2006-12-31 14:06:05 -08:00
2007-02-14 08:09:54 -08:00
2006-06-30 19:25:36 +02:00
2006-06-26 09:58:31 -07:00
2007-02-20 17:10:16 -08:00
2007-02-14 08:09:54 -08:00
2007-02-14 08:09:54 -08:00
2007-02-12 09:48:42 -08:00
2006-12-08 08:29:04 -08:00
2006-12-20 01:46:41 -05:00
2006-12-31 14:06:05 -08:00
2006-12-08 08:29:04 -08:00
2006-01-09 14:53:51 +11:00
2006-07-10 13:24:16 -07:00
2007-02-12 09:48:42 -08:00
2007-02-14 08:09:54 -08:00
2007-02-09 16:23:17 +00:00
2007-02-09 16:23:18 +00:00
2007-02-12 09:48:44 -08:00
2006-12-08 08:29:04 -08:00
2006-12-17 23:37:45 +00:00
2006-10-02 13:33:37 +01:00
2006-07-10 13:24:16 -07:00
2006-06-30 19:25:36 +02:00
2007-02-16 08:14:01 -08:00
2006-10-03 23:01:26 +02:00
2007-02-26 12:56:46 -08:00
2006-12-17 23:37:47 +00:00
2007-02-11 11:18:06 -08:00
2006-03-22 01:15:13 -08:00
2006-01-17 15:53:11 -08:00
2006-06-30 19:25:36 +02:00
2006-07-10 13:24:16 -07:00
2007-03-05 07:57:51 -08:00
2006-12-13 09:05:55 -08:00
2006-03-30 17:48:47 +00:00
2006-12-08 08:29:04 -08:00
2007-02-12 09:48:41 -08:00
2006-12-31 14:06:05 -08:00
2006-07-10 13:24:16 -07:00
2007-02-14 08:09:54 -08:00
2006-12-08 08:29:04 -08:00
2006-07-10 13:24:16 -07:00
2006-10-18 08:53:37 -04:00
2005-04-16 15:20:36 -07:00
2006-12-08 08:29:06 -08:00
2006-07-10 13:24:16 -07:00
2007-02-12 09:48:42 -08:00
2006-06-30 19:25:36 +02:00
2006-03-31 12:19:00 -08:00
2006-03-31 12:19:00 -08:00