Skip to content

Commit 83da212

Browse files
Dan Carpenterakpm00
authored andcommitted
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/[email protected] Fixes: bd23f29 ("tools/testing: add PROCMAP_QUERY helper functions in mm self tests") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Lorenzo Stoakes <[email protected]> Cc: levi.yun <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Wei Yang <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 918850c commit 83da212

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/mm/vm_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ int open_procmap(pid_t pid, struct procmap_fd *procmap_out)
439439
sprintf(path, "/proc/%d/maps", pid);
440440
procmap_out->query.size = sizeof(procmap_out->query);
441441
procmap_out->fd = open(path, O_RDONLY);
442-
if (procmap_out < 0)
442+
if (procmap_out->fd < 0)
443443
ret = -errno;
444444

445445
return ret;

0 commit comments

Comments
 (0)