---
name: "netdev_alloc_skb"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/netdev_alloc_skb"
---

# netdev\_alloc\_skb(9)

allocate an skbuff for rx on a specific device

## NAME

netdev\_alloc\_skb - allocate an skbuff for rx on a specific device

## SYNOPSIS

**struct sk\_buff \* netdev\_alloc\_skb(struct net\_device \*** *dev***, unsigned int** *length***);**

## ARGUMENTS

*dev*

network device to receive on

*length*

length to allocate

## DESCRIPTION

Allocate a new sk\_buff and assign it a usage count of one. The buffer has unspecified headroom built in. Users should allocate the headroom they think they need without accounting for the built in space. The built in space is used for optimisations.

**NULL** is returned if there is no free memory. Although this function allocates memory it can be called from an interrupt.

## COPYRIGHT
