From patchwork Wed Oct 31 07:41:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Wang X-Patchwork-Id: 10662117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ACE273CF1 for ; Wed, 31 Oct 2018 07:39:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 933012A21F for ; Wed, 31 Oct 2018 07:39:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 868172A345; Wed, 31 Oct 2018 07:39:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A13A2A21F for ; Wed, 31 Oct 2018 07:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725961AbeJaQgh (ORCPT ); Wed, 31 Oct 2018 12:36:37 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:12624 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbeJaQgh (ORCPT ); Wed, 31 Oct 2018 12:36:37 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 29A48546F684D577C821; Wed, 31 Oct 2018 15:39:38 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id w9V7dSGe015250; Wed, 31 Oct 2018 15:39:28 +0800 (GMT-8) (envelope-from wang.yi59@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018103115395006-7800048 ; Wed, 31 Oct 2018 15:39:50 +0800 From: Yi Wang To: paul.burton@mips.com, sboyd@kernel.org Cc: mturquette@baylibre.com, linux-mips@linux-mips.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, Yi Wang Subject: [PATCH v3 0/2] fix memory leak and unregister issue in clk_boston_setup() Date: Wed, 31 Oct 2018 15:41:40 +0800 Message-Id: <1540971702-3133-1-git-send-email-wang.yi59@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-10-31 15:39:50, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-10-31 15:39:20, Serialize complete at 2018-10-31 15:39:20 X-MAIL: mse01.zte.com.cn w9V7dSGe015250 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This fix two issues in clk_boston_setup() function: - possible memory leak of 'onecell' - registered clks not unregister when error happens Changes from v2: - include smatch to the commit - unregister clks which registered before going out Yi Wang (2): clk: boston: fix possible memory leak in clk_boston_setup() clk: boston: unregister clks on failure in clk_boston_setup() drivers/clk/imgtec/clk-boston.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)