arm64/signal: Alloc tpidr2 sigframe after checking system_supports_tpidr2()
[linux-2.6-microblaze.git] / arch / arm64 / kernel / signal.c
index 032e97f..2cfc810 100644 (file)
@@ -893,6 +893,13 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user,
                        return err;
        }
 
+       if (system_supports_tpidr2()) {
+               err = sigframe_alloc(user, &user->tpidr2_offset,
+                                    sizeof(struct tpidr2_context));
+               if (err)
+                       return err;
+       }
+
        if (system_supports_sme()) {
                unsigned int vl;
                unsigned int vq = 0;
@@ -902,11 +909,6 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user,
                else
                        vl = task_get_sme_vl(current);
 
-               err = sigframe_alloc(user, &user->tpidr2_offset,
-                                    sizeof(struct tpidr2_context));
-               if (err)
-                       return err;
-
                if (thread_za_enabled(&current->thread))
                        vq = sve_vq_from_vl(vl);