Skip to content

Commit 46e336c

Browse files
committed
Merge branch 'for-next/selftests' into for-next/core
* for-next/selftests: kselftest: arm64: Add a null pointer check kselftest/arm64: Remove unused parameters in abi test
2 parents 42e7ddb + 8016428 commit 46e336c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tools/testing/selftests/arm64/abi/tpidr2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static int write_clone_read(void)
262262

263263
int main(int argc, char **argv)
264264
{
265-
int ret, i;
265+
int ret;
266266

267267
putstr("TAP version 13\n");
268268
putstr("1..");

tools/testing/selftests/arm64/tags/tags_test.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <stdint.h>
77
#include <sys/prctl.h>
88
#include <sys/utsname.h>
9+
#include "../../kselftest.h"
910

1011
#define SHIFT_TAG(tag) ((uint64_t)(tag) << 56)
1112
#define SET_TAG(ptr, tag) (((uint64_t)(ptr) & ~SHIFT_TAG(0xff)) | \
@@ -21,6 +22,9 @@ int main(void)
2122
if (prctl(PR_SET_TAGGED_ADDR_CTRL, PR_TAGGED_ADDR_ENABLE, 0, 0, 0) == 0)
2223
tbi_enabled = 1;
2324
ptr = (struct utsname *)malloc(sizeof(*ptr));
25+
if (!ptr)
26+
ksft_exit_fail_msg("Failed to allocate utsname buffer\n");
27+
2428
if (tbi_enabled)
2529
tag = 0x42;
2630
ptr = (struct utsname *)SET_TAG(ptr, tag);

0 commit comments

Comments
 (0)