[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-newbie
Subject:    Question about devm_kzalloc() and friends
From:       Rajat Jain <rajatxjain () gmail ! com>
Date:       2015-11-19 20:38:24
Message-ID: CAA93t1oPgQt8gYDUfQu25CrhP0MQ5oPNNmV-YrWoOFvXUXZR9g () mail ! gmail ! com
[Download RAW message or body]

Hi,

Can some one tell me if that memory allocated by these functions is
freed when the last reference (pointer) to the MEMORY goes out of
scope, or when the last reference to the DEVICE is put?

For instance:

probe()
{
    ptr = devm_kzalloc(dev, ....)
    ptr = devm_kzalloc(dev,.....)
}

The reference to the first memory goes away as soon as I make the
second call, but the device stays around. So when is the first memory
freed? At the second call or at the device removal time?

Thanks,

Rajat
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic