ceph: avoid possible null deref in readdir after dir llseek
authorSage Weil <sage@newdream.net>
Tue, 23 Nov 2010 06:58:06 +0000 (22:58 -0800)
committerSage Weil <sage@newdream.net>
Wed, 1 Dec 2010 22:15:31 +0000 (14:15 -0800)
commit884ea892763d4dfba509743f65961c782c0442db
tree92a7f5b67aa06cf32457ccb2b69c28c528a48c15
parent3561d43fd289f590fdae672e5eb831b8d5cf0bf6
ceph: avoid possible null deref in readdir after dir llseek

last may be NULL, but we dereference it in the else branch without
checking.  Normally it doesn't trigger because last == NULL when fpos == 2,
but it could happen on a newly opened dir if the user seeks forward.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/dir.c