The remain buff size is 'len - pos->long_name_len - 1', not
'len - pos->long_name_len + 1'
This bug was introduced by commit
7691b1e ("perf tools: Misc small
fixes").
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <
4B1C7F73.80707@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
err = do_write(fd, pos->long_name, pos->long_name_len + 1);
if (err < 0)
return err;
- err = do_write(fd, zero_buf, len - pos->long_name_len + 1);
+ err = do_write(fd, zero_buf, len - pos->long_name_len - 1);
if (err < 0)
return err;
}