From: Jeff Layton Date: Fri, 2 Dec 2011 01:23:34 +0000 (-0500) Subject: cifs: check for NULL last_entry before calling cifs_save_resume_key X-Git-Tag: v3.2-rc5~1^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7023676f9ee851d94f0942e879243fc1f9081c47;p=pandora-kernel.git cifs: check for NULL last_entry before calling cifs_save_resume_key Prior to commit eaf35b1, cifs_save_resume_key had some NULL pointer checks at the top. It turns out that at least one of those NULL pointer checks is needed after all. When the LastNameOffset in a FIND reply appears to be beyond the end of the buffer, CIFSFindFirst and CIFSFindNext will set srch_inf.last_entry to NULL. Since eaf35b1, the code will now oops in this situation. Fix this by having the callers check for a NULL last entry pointer before calling cifs_save_resume_key. No change is needed for the call site in cifs_readdir as it's not reachable with a NULL current_entry pointer. This should fix: https://bugzilla.redhat.com/show_bug.cgi?id=750247 Cc: stable@vger.kernel.org Cc: Christoph Hellwig Reported-by: Adam G. Metzler Signed-off-by: Jeff Layton Signed-off-by: Steve French --- Reading git-diff-tree failed