probe fail, what with devm_kzalloc, kcalloc data?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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???
...
}

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux