Question about copy_from/copy_to

Linux Geek (linux-geek@hornyaksys.com)
Wed, 27 Nov 2002 15:26:59 -0500


I'm trying to write a device driver (module) for one of my customers and
have the following problem.

kernel veraion 2.4.18...

Memory is allocated (kmalloc) in the "open" call.

The above memory is used in copy_from/to in the "ioctl" (and possibly
the read/write) call.

I understand that the copy_from/to may wait for pages to be swapped in,
If the waiting process is killed at this point, is it safe to free the
memory in the "close/release" call? If not, when is it safe to call kfree?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/