Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751704AbdG0WhH (ORCPT ); Thu, 27 Jul 2017 18:37:07 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:15215 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751653AbdG0WhF (ORCPT ); Thu, 27 Jul 2017 18:37:05 -0400 Subject: Re: [PATCH v3 1/3] ptp: introduce ptp auxiliary worker To: Richard Cochran CC: "David S. Miller" , , Sekhar Nori , , , Wingman Kwok , Ivan Khoronzhuk , John Stultz , Thomas Gleixner References: <20170726221138.12986-1-grygorii.strashko@ti.com> <20170726221138.12986-2-grygorii.strashko@ti.com> <20170727200829.cqe2gb6kl4lfzyux@localhost.localdomain> From: Grygorii Strashko Message-ID: <74a827c9-467e-8791-3c97-9fc4c591435f@ti.com> Date: Thu, 27 Jul 2017 17:36:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170727200829.cqe2gb6kl4lfzyux@localhost.localdomain> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [128.247.59.147] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 891 Lines: 35 On 07/27/2017 03:08 PM, Richard Cochran wrote: > On Wed, Jul 26, 2017 at 05:11:36PM -0500, Grygorii Strashko wrote: >> @@ -217,6 +231,19 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, >> mutex_init(&ptp->pincfg_mux); >> init_waitqueue_head(&ptp->tsev_wq); >> >> + if (ptp->info->do_aux_work) { >> + char *worker_name = kasprintf(GFP_KERNEL, "ptp%d", ptp->index); > > This string is allocated but never freed. > >> + kthread_init_delayed_work(&ptp->aux_work, ptp_aux_kworker); >> + ptp->kworker = kthread_create_worker(0, worker_name ? >> + worker_name : info->name); Ops. Right need to add kfree(worker_name) here. >> + if (IS_ERR(ptp->kworker)) { >> + err = PTR_ERR(ptp->kworker); >> + pr_err("failed to create ptp aux_worker %d\n", err); >> + goto kworker_err; >> + } >> + } >> + > > Thanks, > Richard > -- regards, -grygorii