---
name: "devm_kstrdup"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/devm_kstrdup"
---

# devm\_kstrdup(9)

Allocate resource managed space and copy an existing string into that.

## NAME

devm\_kstrdup - Allocate resource managed space and copy an existing string into that.

## SYNOPSIS

**char \* devm\_kstrdup(struct device \*** *dev***, const char \*** *s***, gfp\_t** *gfp***);**

## ARGUMENTS

*dev*

Device to allocate memory for

*s*

the string to duplicate

*gfp*

the GFP mask used in the **devm\_kmalloc** call when allocating memory

## RETURNS

Pointer to allocated string on success, NULL on failure.

## COPYRIGHT
