Sigh...
a) mixing of userland and kernel pointers is bad
b) so's not checking result of kmalloc()
c) so's not checking result of copy_from_user()
d) use of do { .... break; ... break; ... } while(0); is *highly*
unidiomatic. Do not confuse kernel with IOCCC, please. And if you have
religious aversion to multiple return statements in a function, at least
learn the reasons why it is frowned upon in many situations. Hint: they
all apply to use of break in that manner.
e) 0 instead of NULL
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>