@@ -121,7 +121,7 @@ tracecmd_create_buffer_recorder_fd2(int fd, int fd2, int cpu, unsigned flags,
{
struct tracecmd_recorder *recorder;
char *path = NULL;
- int pipe_size;
+ int pipe_size = 0;
int ret;
recorder = malloc(sizeof(*recorder));
@@ -183,9 +183,10 @@ tracecmd_create_buffer_recorder_fd2(int fd, int fd2, int cpu, unsigned flags,
/*
* F_GETPIPE_SZ was introduced in 2.6.35, ftrace was introduced
* in 2.6.31. If we are running on an older kernel, just fall
- * back to using page_size for splice().
+ * back to using page_size for splice(). It could also return
+ * success, but not modify pipe_size.
*/
- if (ret < 0)
+ if (ret < 0 || !pipe_size)
pipe_size = recorder->page_size;
recorder->pipe_size = pipe_size;