Thread (11 messages) flat view 11 messages, 3 authors, 2017-06-12

Re: [PATCH v9 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging

From: Thomas Gleixner <hidden>
Date: 2017-06-12 22:44:33
Also in: lkml

On Wed, 7 Jun 2017, Anju T Sudhakar wrote:
On Tuesday 06 June 2017 03:39 PM, Thomas Gleixner wrote:
quoted
On Mon, 5 Jun 2017, Anju T Sudhakar wrote:
quoted
+static void cleanup_all_core_imc_memory(struct imc_pmu *pmu_ptr)
+{
+	struct imc_mem_info *ptr = pmu_ptr->mem_info;
+
+	if (!ptr)
+		return;
That's pointless.
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.
What's the problem with that. kfree() CAN be called with a NULL pointer. It
has a check already.

Thanks,

	tglx
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help