Skip to content

Commit

Permalink
ustat02: Fix EFAULT in 32bit compatibility mode
Browse files Browse the repository at this point in the history
The size of dev_t is larger than 32 bits which causes the dev argument
to be passed incorrectly. On Arm this means that the EFAULT test case
actually returns EINVAL because the device number isn't recognised.

Signed-off-by: Steven Price <steven.price@arm.com>
Acked-by: Li Wang <liwang@redhat.com>
  • Loading branch information
Steven Price authored and wangli5665 committed Jul 23, 2019
1 parent 5ff4656 commit 156776a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testcases/kernel/syscalls/ustat/ustat02.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int TST_TOTAL = ARRAY_SIZE(tc);

void run(unsigned int test)
{
TEST(tst_syscall(__NR_ustat, *tc[test].dev, tc[test].buf));
TEST(tst_syscall(__NR_ustat, (unsigned int)*tc[test].dev, tc[test].buf));

if ((TST_RET == -1) && (TST_ERR == tc[test].exp_errno))
tst_res(TPASS | TTERRNO, "ustat(2) expected failure");
Expand Down

0 comments on commit 156776a

Please sign in to comment.