Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8151679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:27:49+00:00 2026-06-06T15:27:49+00:00

static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = { .forwarding = 0, .hop_limit = IPV6_DEFAULT_HOPLIMIT, .mtu6

  • 0
static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
    .forwarding     = 0,
    .hop_limit      = IPV6_DEFAULT_HOPLIMIT,
    .mtu6           = IPV6_MIN_MTU,
};

static int __net_init addrconf_init_net(struct net *net)
{
    struct ipv6_devconf *dflt;
    dflt = &ipv6_devconf_dflt;
    kfree(dflt);
}

ipv6_devconf_dflt is a static structure variable. Address of ipv6_devconf_dflt is assigned to local variable. which is then freed using kfree().

Is it allowed to free non-heap memory?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:27:51+00:00Added an answer on June 6, 2026 at 3:27 pm

    No—it doesn’t make sense to free memory outside the heap, because kfree() only works to free up memory in the context of kmalloc()ed chunks!

    Timeline:

    • Committed in January 2008 when the IPv6 devconfs for namespaces came into being.
    • Noticed on linux-netdev in August 2008, to no fanfare.
    • Pointed out again on the LKML in 2010, with a patch request coming back from the original author, with no patch ever materialised.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

// File: InitFirst.h #pragma once template <int val> struct InitFirst { static float s_dividedByThree;
Suppose I have a static function template template<int I> void ft() within a struct
I have the following code: #include <boost/shared_ptr.hpp> struct Foo { int a; }; static
static struct K { int x; }; Is this valid in C and C++?
#include <stdio.h> int main (int argc, const char * argv[]) { static struct item
To have a sort of duck typing, I do template<bool b> struct A{ static
struct X { constexpr static char a1[] = hello; // Okay constexpr static const
typedef struct _ut_slot { ucontext_t uc; .... }*ut_slot; static ut_slot* table; //array of the
template<typename T> struct AClass { public: template<typename T0> static void AFunc() {} }; template<typename
static void Main(string[] args) { int a=0000001; for (int i=0; i <= 5; i++)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.