Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755606AbbHZMwH (ORCPT ); Wed, 26 Aug 2015 08:52:07 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35881 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859AbbHZMwE (ORCPT ); Wed, 26 Aug 2015 08:52:04 -0400 Date: Wed, 26 Aug 2015 18:21:58 +0530 From: Viresh Kumar To: Javi Merino Cc: Vaishali Thakkar , Zhang Rui , Eduardo Valentin , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] thermal: cpu_cooling: Remove usage of devm functions Message-ID: <20150826125158.GM8784@linux> References: <20150820161402.GA4951@localhost> <20150826124736.GA10956@e104805> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150826124736.GA10956@e104805> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 725 Lines: 29 On 26-08-15, 13:47, Javi Merino wrote: > I missed this because I wasn't CCed :( Thankfully, I'll be in > MAINTAINERS for this soon. Yeah, I need to resend that patch soon :) > > - devm_kfree(&cdev->device, load_cpu); > > This introduces a memory leak. Keep the kfree() here, you can't drop > it. Cheers, > Javi > > > - } > > - > > *power = static_power + dynamic_power; > > return 0; > > + > > +free: > > + kfree(load_cpu); Wouldn't this make that work ? -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/