free_netdev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… free_netdev(9) β€” the Kernel API Manual glow-up ✨

okay so bestie, we're in the Kernel API Manual, section 9, and today's main character is free_netdev β€” the function that gives a network device its final send-off πŸŽ€ no cap, it's the last thing that happens to a net_device before it stops existing.


🌸 NAME 🌸

free_netdev β€” free network device πŸ’€βœ¨ (yes that's the whole name, she's straightforward, we love that for her)


πŸ¦‹ SYNOPSIS πŸ¦‹

void free_netdev (struct net_device *dev );

Return type is void, meaning she gives you nothing back β€” which is honestly iconic. She takes exactly one thing and she's done 🫢


πŸ“ ARGUMENTS πŸ“

  • dev β€” the device. that's it. that's the argument. it's the network device you're about to release into the void πŸ’œ

πŸ”₯ DESCRIPTION πŸ”₯

So here's the tea β˜• β€” free_netdev does the last stage of destroying an allocated device interface. Not the first stage, not the middle stage, the last one. She's the closing act at the award show 🎬

What actually happens: the reference to the device object is released. And if this is the last reference, then it will be freed. That's the whole vibe β€” refcount goes down, and if it hits the floor, the object is gone gone 😭

⚠️ Important bestie alert: this function must be called in process context. Not interrupt context. Not "wherever, it'll be fine" context. Process context. periodt. πŸ’…

πŸ’– SEE ALSO πŸ’–

Everything below lives over at the kernel file ./net/core/dev.c, and it's giving extended family reunion β€” here's the full guest list, no plus-ones skipped, iykyk 🌈


and that's the whole page, bestie β€” go forth and release your references responsibly πŸ§šβ€β™€οΈ

with love from the ./net/core girlies, October 2026, stay slay βœ¨πŸ’œ

πŸ“¦ where this page comes from