devm_kmalloc(9)

devm_kmalloc9

Resource-managed kmalloc

Usage

void * devm_kmalloc(struct device * dev, size_t size, gfp_t gfp);

Arguments

dev

Device to allocate memory for

size

Allocation size

gfp

Allocation gfp flags

Overview

Managed kmalloc. Memory allocated with this function is automatically freed on driver detach. Like all other devres resources, guaranteed alignment is unsigned long long.

Returns

Pointer to allocated memory on success, NULL on failure.

From linux-manual-3.16 3.16.56-1+deb8u1 in Debian 8 (Jessie). Parsed by carta from the page's man source.