probe fail, what with devm_kzalloc, kcalloc data?
April 3, 2020
12:47 p.m.
Hi What happens with devm_kzalloc and devm_kcalloc data when probe function returns not 0? Is this memory automatically deallocated? Example below: static struct my_data* my_static_pointer; static int somedriver_do_probe(struct platform_device *pdev) { int ret; struct device *dev = &pdev->dev; dev_info(dev, "probe\n"); my_static_pointer= devm_kzalloc(dev, sizeof(struct my_data), GFP_KERNEL); if (! my_static_pointer ) return -ENOMEM; .... let's say memory was also allocated with devm_kcalloc somewhere in the meantime ... //do sthm: if (ret != 0 ) return -EINVAL; //let's assume there we returned from probe, what with allocated so far memory??? ... }
2324
Age (days ago)
2324
Last active (days ago)
1 comments
2 participants
participants (2)
-
Greg KH -
Tomek The Messenger