diff options
| author | Bastian Germann <bage@debian.org> | 2026-04-27 13:24:16 +0200 |
|---|---|---|
| committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2026-08-03 07:42:05 +0200 |
| commit | d1f2d1270c15e373c4e4b5bfbe0a83c7bcf6e793 (patch) | |
| tree | 523bbfcb76cf0832f786748d896ba277ddeb8a21 /tests/mtd-tests/Makemodule.am | |
| parent | 73b8c2e23412c9dc306ac251c6bf9ab6b8aaffeb (diff) | |
lib: libmtd: fix sign extension of ioctl request in mtd_xlock
The req parameter of mtd_xlock() was declared as int. On 64-bit
big-endian architectures such as ppc64el, _IOW()-derived ioctl numbers
have bit 31 set (because _IOC_WRITE=4 is placed at bit 29). Storing
such a value in a signed int and then passing it to ioctl(), whose
second argument is unsigned long, causes implicit sign extension:
0x80084d05 becomes 0xffffffff80084d05, which does not match the
expected constant and fails the cmocka check_expected() assertion in
the unit tests for mtd_lock and mtd_unlock.
Fix by declaring req as unsigned long, matching the type used by the
ioctl() syscall interface.
Fixes: test_mtd_lock / test_mtd_unlock failures on ppc64el
Signed-off-by: Bastian Germann <bage@debian.org>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/mtd-tests/Makemodule.am')
0 files changed, 0 insertions, 0 deletions
