other versions
DEVM_KMALLOC(9) | Driver Basics | DEVM_KMALLOC(9) |
NAME¶
devm_kmalloc - Resource-managed kmallocSYNOPSIS¶
void *
devm_kmalloc(struct device * dev,
size_t size, gfp_t gfp);
ARGUMENTS¶
devDevice to allocate memory for
size
Allocation size
gfp
Allocation gfp flags
DESCRIPTION¶
Managed kmalloc. Memory allocated with this function is automatically freed on driver detach. Like all other devres resources, guaranteed alignment is unsigned long long.RETURN¶
Pointer to allocated memory on success, NULL on failure.COPYRIGHT¶
January 2017 | Kernel Hackers Manual 4.8. |