Hi Fabiano,
On 05/22/2019 09:37 PM, Fabiano Rosas wrote:
Shivaprasad G Bhat <sb...@linux.ibm.com> writes:
+ /* Create DT entries for cold plugged NVDIMM devices */
+ dimms = nvdimm_get_device_list();
+ for (; dimms; dimms = dimms->next) {
+ NVDIMMDevice *nvdimm = dimms->data;
+
+ spapr_populate_nvdimm_node(fdt, offset, nvdimm);
+ }
+ g_slist_free(dimms);
To free the whole list you'll need another variable in the loop above,
right?
Nope. TheĀ g_slist_free() takes care of freeing the list node pointers.
As I am iterating using the original dimms variable, I would still not
be freeing the list here though, fixing that in next version.
Valgrind pointed out few more leaks in many places, will fix them all.
Cheers