Skip to content
Commit 90b2433e authored by Maíra Canal's avatar Maíra Canal Committed by Al Viro
Browse files

seq_file: fix NULL pointer arithmetic warning



Implement conditional logic in order to replace NULL pointer arithmetic.

The use of NULL pointer arithmetic was pointed out by clang with the
following warning:

fs/kernfs/file.c:128:15: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
                return NULL + !*ppos;
                       ~~~~ ^
fs/seq_file.c:559:14: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
        return NULL + (*pos == 0);

Signed-off-by: default avatarMaíra Canal <maira.canal@usp.br>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 6692531d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment