tracing: Fix crash from reading trace_pipe with sendfile
[pandora-kernel.git] / kernel / trace / trace.c
index 0c348a6..f4b93a2 100644 (file)
@@ -3565,7 +3565,10 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
 
        spd.nr_pages = i;
 
-       ret = splice_to_pipe(pipe, &spd);
+       if (i)
+               ret = splice_to_pipe(pipe, &spd);
+       else
+               ret = 0;
 out:
        splice_shrink_spd(&spd);
        return ret;