---
name: "kfifo_alloc"
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/kfifo_alloc"
---

# kfifo\_alloc(9)

dynamically allocates a new fifo buffer

## NAME

kfifo\_alloc - dynamically allocates a new fifo buffer

## SYNOPSIS

**kfifo\_alloc(***fifo***,** *size***,** *gfp\_mask***);**

## ARGUMENTS

*fifo*

pointer to the fifo

*size*

the number of elements in the fifo, this must be a power of 2

*gfp\_mask*

get\_free\_pages mask, passed to **kmalloc**

## DESCRIPTION

This macro dynamically allocates a new fifo buffer.

The numer of elements will be rounded-up to a power of 2. The fifo will be release with **kfifo\_free**. Return 0 if no error, otherwise an error code.

## COPYRIGHT
