]> git.neil.brown.name Git - history.git/commit
[PATCH] openpromfs property_read() fix
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Wed, 2 Feb 2005 05:15:59 +0000 (21:15 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 2 Feb 2005 05:15:59 +0000 (21:15 -0800)
commit622c36a694e8fd071c05bc03d618d6840c762d1b
treefa8cb689ca4a8459ae4aa68c726168d8ea1fc56a
parent00acc832e3d9a5bab2358f3c9392f7dc7583a5b2
[PATCH] openpromfs property_read() fix

openpromfs property_read() is slightly abused by property_write() - the
latter calls property_read(file, NULL, 0, NULL) if we still hadn't done
any IO on that file; property_read() will do setup work and, since it's
called with count equal to 0, do nothing else.

That stopped working - now we check if *ppos is sane before doing
anything else and that, of course, oopses.  Trivial fix is to move the
check past that for count == 0...

Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/openpromfs/inode.c