probe fail, what with devm_kzalloc, kcalloc data?
Tomek The Messenger
tomekthemessenger at gmail.com
Fri Apr 3 08:47:50 EDT 2020
What happens with devm_kzalloc and devm_kcalloc data when probe function
returns not 0?
Is this memory automatically deallocated?
static struct my_data* my_static_pointer;
static int somedriver_do_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
my_static_pointer= devm_kzalloc(dev, sizeof(struct my_data), GFP_KERNEL);
if (! my_static_pointer )
let's say memory was also allocated with devm_kcalloc somewhere in the
if (ret != 0 )
return -EINVAL; //let's assume there we returned from probe, what with
allocated so far memory???
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Kernelnewbies