@@ -95,19 +95,27 @@ static int do_child(void)
9595static int get_fpsimd (pid_t pid , struct user_fpsimd_state * fpsimd )
9696{
9797 struct iovec iov ;
98+ int ret ;
9899
99100 iov .iov_base = fpsimd ;
100101 iov .iov_len = sizeof (* fpsimd );
101- return ptrace (PTRACE_GETREGSET , pid , NT_PRFPREG , & iov );
102+ ret = ptrace (PTRACE_GETREGSET , pid , NT_PRFPREG , & iov );
103+ if (ret == -1 )
104+ ksft_perror ("ptrace(PTRACE_GETREGSET)" );
105+ return ret ;
102106}
103107
104108static int set_fpsimd (pid_t pid , struct user_fpsimd_state * fpsimd )
105109{
106110 struct iovec iov ;
111+ int ret ;
107112
108113 iov .iov_base = fpsimd ;
109114 iov .iov_len = sizeof (* fpsimd );
110- return ptrace (PTRACE_SETREGSET , pid , NT_PRFPREG , & iov );
115+ ret = ptrace (PTRACE_SETREGSET , pid , NT_PRFPREG , & iov );
116+ if (ret == -1 )
117+ ksft_perror ("ptrace(PTRACE_SETREGSET)" );
118+ return ret ;
111119}
112120
113121static struct user_sve_header * get_sve (pid_t pid , const struct vec_type * type ,
@@ -117,6 +125,7 @@ static struct user_sve_header *get_sve(pid_t pid, const struct vec_type *type,
117125 void * p ;
118126 size_t sz = sizeof * sve ;
119127 struct iovec iov ;
128+ int ret ;
120129
121130 while (1 ) {
122131 if (* size < sz ) {
@@ -132,8 +141,11 @@ static struct user_sve_header *get_sve(pid_t pid, const struct vec_type *type,
132141
133142 iov .iov_base = * buf ;
134143 iov .iov_len = sz ;
135- if (ptrace (PTRACE_GETREGSET , pid , type -> regset , & iov ))
144+ ret = ptrace (PTRACE_GETREGSET , pid , type -> regset , & iov );
145+ if (ret ) {
146+ ksft_perror ("ptrace(PTRACE_GETREGSET)" );
136147 goto error ;
148+ }
137149
138150 sve = * buf ;
139151 if (sve -> size <= sz )
@@ -152,10 +164,14 @@ static int set_sve(pid_t pid, const struct vec_type *type,
152164 const struct user_sve_header * sve )
153165{
154166 struct iovec iov ;
167+ int ret ;
155168
156169 iov .iov_base = (void * )sve ;
157170 iov .iov_len = sve -> size ;
158- return ptrace (PTRACE_SETREGSET , pid , type -> regset , & iov );
171+ ret = ptrace (PTRACE_SETREGSET , pid , type -> regset , & iov );
172+ if (ret == -1 )
173+ ksft_perror ("ptrace(PTRACE_SETREGSET)" );
174+ return ret ;
159175}
160176
161177/* Validate setting and getting the inherit flag */
0 commit comments