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

# list\_safe\_reset\_next(9)

reset a stale list\_for\_each\_entry\_safe loop

## NAME

list\_safe\_reset\_next - reset a stale list\_for\_each\_entry\_safe loop

## SYNOPSIS

**list\_safe\_reset\_next(***pos***,** *n***,** *member***);**

## ARGUMENTS

*pos*

the loop cursor used in the list\_for\_each\_entry\_safe loop

*n*

temporary storage used in list\_for\_each\_entry\_safe

*member*

the name of the list\_head within the struct.

## DESCRIPTION

list\_safe\_reset\_next is not safe to use in general if the list may be modified concurrently (eg. the lock is dropped in the loop body). An exception to this is if the cursor element (pos) is pinned in the list, and list\_safe\_reset\_next is called after re-taking the lock and before completing the current iteration of the loop body.

## COPYRIGHT
