On Thu, 21 May 2026 16:25:29 +0200
Jens Remus <[email protected]> wrote:

>  int sframe_remove_section(unsigned long sframe_start)
>  {
> -     return -ENOSYS;
> +     struct mm_struct *mm = current->mm;
> +     struct sframe_section *sec;
> +     unsigned long index = 0;
> +     bool found = false;
> +     int ret = 0;
> +
> +     guard(srcu)(&sframe_srcu);
> +
> +     mt_for_each(&mm->sframe_mt, sec, index, ULONG_MAX) {
> +             if (sec->sframe_start == sframe_start) {
> +                     found = true;
> +                     ret |= __sframe_remove_section(mm, sec);

Because this is all internal data, the __sframe_remove_section() should
never fail. Perhaps we should add a WARN_ON() if it does?

                if (sec->sframe_start == sframe_start) {
                        ret |= __sframe_remove_section(mm, sec);
                        WARN_ON(!found && ret);
                        found = true;

-- Steve



> +             }
> +     }
> +
> +     if (!found || ret)
> +             return -EINVAL;
> +
> +     return 0;
> +}
> +

Reply via email to