From: Slava Pestov Date: Wed, 24 Nov 2010 23:13:16 +0000 (-0800) Subject: tracing: Fix panic when lseek() called on "trace" opened for writing X-Git-Tag: v2.6.37-rc7~14^3^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=364829b1263b44aa60383824e4c1289d83d78ca7;p=pandora-kernel.git tracing: Fix panic when lseek() called on "trace" opened for writing The file_ops struct for the "trace" special file defined llseek as seq_lseek(). However, if the file was opened for writing only, seq_open() was not called, and the seek would dereference a null pointer, file->private_data. This patch introduces a new wrapper for seq_lseek() which checks if the file descriptor is opened for reading first. If not, it does nothing. Cc: Signed-off-by: Slava Pestov LKML-Reference: <1290640396-24179-1-git-send-email-slavapestov@google.com> Signed-off-by: Steven Rostedt --- Reading git-diff-tree failed