Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5920047imu; Sun, 20 Jan 2019 23:26:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN5X+36uQqaWj8mMFhIGHkit7eagWP0Q6Hb+87eYRq5Iq4MLeiCmBlFpEVfMxOtO2ePiKH8O X-Received: by 2002:a62:2e46:: with SMTP id u67mr28268374pfu.3.1548055617002; Sun, 20 Jan 2019 23:26:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548055616; cv=none; d=google.com; s=arc-20160816; b=KU8zfDInDCo0mOGYjD0xnHwaV6Bcm+gdip0BXbxuxxZSC/O0FTaoyyiptjq9NSUGSb oiSLFA3QXydFXBqq2Lk7cgmf/pwUMOkBVExkyY9amcxNZwLsijM18KsYSuxz+mq/hhMo yJGdROsPEVRq/UMVHi5JmenF0IJV6U16nBynToOi3MnSTVcyUlHdoLLI8pUQF8OaFJgs fYMAaHtUMVV/8246YErudqKRUGYkGThxvLI192w2ywPhB+ZehnJ1h9t5drTy+RfSIItB tMhTWHGR/Zg8dFQ1iSavi2M7QS8gIL9Hy3JQzc+wlZ86fqzqJZkHhoXD0S/dDQsXtwdY eMLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:date:message-id:in-reply-to:cc:to:from :reply-to:subject:mime-version:dkim-signature:dkim-filter; bh=wUoKP7HmrawMJwkdmht0fjJJqjkQkO/cE4wFGiifKIY=; b=KOuaRNU2DA0GBsrxiX4EiM7Kf/A//UgjGj7lNPRsrEtNhefhxJNSyoe//S+q7Bn7fN NhUC2MG63eE3rMO3DLFPxLzeO/qyOM+bbS1sLFbU58aPtPK1ygmnL0KWLfs/tWm5cBiJ m6Yo6+nBx1rd26zlUkypK79QQt8r0iNzZqxyjedLnzRLwhvNx5KAQ/2JaQUGjWX83alv Au7RVS7zw+PsEm0x8FbyfAMedA2AMUg73WoZ+pR2GdHTRuqgaKEVlIH4soca4iFcL3AX /axSW65ncet/ZE6/b/azmt8IFw1HSSxk1p8W6DmWkpC4ifPxHhd6fHi7Z7BvVfLqtPiW AIBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=dJ8utWdy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b36si11915745pla.354.2019.01.20.23.26.41; Sun, 20 Jan 2019 23:26:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=dJ8utWdy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727966AbfAUHXr (ORCPT + 99 others); Mon, 21 Jan 2019 02:23:47 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:51786 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727868AbfAUHXq (ORCPT ); Mon, 21 Jan 2019 02:23:46 -0500 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190121012358epoutp0323462fd38b9b32698e0af494ebf618ae~7uJL6LKNR2070220702epoutp03d for ; Mon, 21 Jan 2019 01:23:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190121012358epoutp0323462fd38b9b32698e0af494ebf618ae~7uJL6LKNR2070220702epoutp03d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548033838; bh=wUoKP7HmrawMJwkdmht0fjJJqjkQkO/cE4wFGiifKIY=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=dJ8utWdyx6XXyCK0Hh61z4s8Zq3AXfQ7fpL7YKeRmYs+aVfLUP68noG8HZFisT0Km whLQz7sX0QlbwS33gpqhWPLBZeld/2V+07c3zd4lZ5BSV4Y2UES2XJwIZSMod55bBF rRAMHe+pAZpLPxDjDsxBJgxLF0dB2qJC3Ag/dIEc= Received: from epsmges1p2.samsung.com (unknown [182.195.40.156]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20190121012356epcas1p34d8e33353906f0165ba937858212656a~7uJKK98351948319483epcas1p3e; Mon, 21 Jan 2019 01:23:56 +0000 (GMT) X-AuditID: b6c32a36-5c1ff7000000104d-c9-5c451f27b186 Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 91.B3.04173.72F154C5; Mon, 21 Jan 2019 10:23:51 +0900 (KST) Mime-Version: 1.0 Subject: RE: [PATCH 3/3] PM / devfreq: fix mem leak in devfreq_add_device() Reply-To: myungjoo.ham@samsung.com From: MyungJoo Ham To: "linux-pm@vger.kernel.org" , Yangtao Li CC: Kyungmin Park , Chanwoo Choi , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20190119160454.23151-3-tiny.windzz@gmail.com> X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20190121012351epcms1p59b810ea2b6ebdaf80a85fbe17b60d1bf@epcms1p5> Date: Mon, 21 Jan 2019 10:23:51 +0900 X-CMS-MailID: 20190121012351epcms1p59b810ea2b6ebdaf80a85fbe17b60d1bf Content-Transfer-Encoding: 7bit Content-Type: text/pl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5qLiRABdrDTQiAMAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190119183505epcas1p15efda0795b3c94601bcb2f442ab15232 References: <20190119160454.23151-3-tiny.windzz@gmail.com> <20190119160454.23151-1-tiny.windzz@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >'devfreq' is malloced in devfreq_add_device() and should be freed in >the error handling cases, otherwise it will cause memory leak. > >Signed-off-by: Yangtao Li Acked-by: MyungJoo Ham >--- > drivers/devfreq/devfreq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c >index 923889229a0b..fe6c157cb7e0 100644 >--- a/drivers/devfreq/devfreq.c >+++ b/drivers/devfreq/devfreq.c >@@ -651,7 +651,7 @@ struct devfreq *devfreq_add_device(struct device *dev, > mutex_unlock(&devfreq->lock); > err = set_freq_table(devfreq); > if (err < 0) >- goto err_out; >+ goto err_dev; > mutex_lock(&devfreq->lock); > } >