Hi Thomas,
On Tuesday 06 June 2017 03:39 PM, Thomas Gleixner wrote:
On Mon, 5 Jun 2017, Anju T Sudhakar wrote:
+static void cleanup_all_core_imc_memory(struct imc_pmu *pmu_ptr)That's pointless.
+{
+ struct imc_mem_info *ptr = pmu_ptr->mem_info;
+
+ if (!ptr)
+ return;
No, it is not. We may end up here from imc_mem_init() when the memory allocation for
pmu_ptr->mem_info fails. So in that case we can just return from here, and kfree wont be
called with a NULL pointer.
+ for (; ptr; ptr++) {for (ptr = pmu_ptr->mem_info; ptr; ptr++) {
will do the right thing.
+ if (ptr->vbase[0] != 0)and kfree can be called with a NULL pointer.
+ free_pages(ptr->vbase[0], 0);
+ }