In article <20140202043534.ga8...@homeworld.netbsd.org>,
Emmanuel Dreyfus  <m...@netbsd.org> wrote:

>Latest revision of the netbsd32 swapctl patch
>
>+      for (i = 0; i < count; i++) {
>+              sep32[i].se_dev = sep[i].se_dev;
>+              sep32[i].se_flags = sep[i].se_flags;
>+              sep32[i].se_nblks = sep[i].se_nblks;
>+              sep32[i].se_inuse = sep[i].se_inuse;
>+              sep32[i].se_priority = sep[i].se_priority;
>+              memcpy(sep32[i].se_path, sep[i].se_path,
>+                      sizeof(sep32[i].se_path));
>+      }
>+
>+      error = copyout(sep32, SCARG(uap, arg), sizeof(*sep32) * count);

I thought we decided that it is better to have one sep32 on the stack
and do copyout in the loop.

>+out:
>+      kmem_free(sep, sizeof(*sep));
>+      kmem_free(sep32, sizeof(*sep32));

The sizes are wrong.

christos

Reply via email to