mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
tools/testing: check correct variable in open_procmap()
Check if "procmap_out->fd" is negative instead of "procmap_out" (which is
a pointer).
Link: https://lkml.kernel.org/r/aDbFuUTlJTBqziVd@stanley.mountain
Fixes: bd23f293a0 ("tools/testing: add PROCMAP_QUERY helper functions in mm self tests")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: levi.yun <yeoreum.yun@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
918850c136
commit
83da212b7f
|
|
@ -439,7 +439,7 @@ int open_procmap(pid_t pid, struct procmap_fd *procmap_out)
|
|||
sprintf(path, "/proc/%d/maps", pid);
|
||||
procmap_out->query.size = sizeof(procmap_out->query);
|
||||
procmap_out->fd = open(path, O_RDONLY);
|
||||
if (procmap_out < 0)
|
||||
if (procmap_out->fd < 0)
|
||||
ret = -errno;
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user