Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5915447imu; Sun, 20 Jan 2019 23:20:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN6aIX+khJly/qMhyvhU7hnIcy8mcMW6ajo/zpLWrRWzUrr7C2vk5Lr9AyPb2P0W2QxdAyhx X-Received: by 2002:a17:902:24d:: with SMTP id 71mr28231099plc.225.1548055232193; Sun, 20 Jan 2019 23:20:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548055232; cv=none; d=google.com; s=arc-20160816; b=Sn5xG0qMYl3/Zt8gnVRN861MY0GY10qKyuL1wliXoUPx28cEHR5/X2ZNnmlDajCmyG k9g7zWq4KEX8nZ4EqUQo1RgwTWAGbqq89Uvm5RpT1vVFxLQbOJOwQHYCPvqlAdVvKnHh O66nE5C2NiQr5/CLZPuU9bgdBPFMDTt6LFsYRf6zsy3xO0oEXhvOJYBWgYWQfevDKFDB Fd0p11JFOWu7dh6LX1lEXs85NJ2Kdgg0ENo2ksKY4sfUxjjPf589+SjnCweJin4aTcI5 0OYnmODAGgMEBgi1bghghiZluFGAQEsHFypI6YlH+6/kPmnieHyeqvXwZt77Xy1XZMAN IBjw== 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=6N90+D9Kx4hm6L3DEeAsRZgnyLjoWOs+CamGvaVC6zM=; b=CZ14+1WAy9WLDWtZj4i7EEdaY/yuajHF7OTohRUxPjA6f3wNGjUWwrC+dOO/Gmy1Ln 1RZXYf+dptSetWjVKazFU9PGkXo56QKWEWBH1VSoK2pUnZ8wNmbmDDLMBpZjfrj35/KA lpBo9ANHuUPe8cp2Whchu6OCmugtdrDgT4GeQdcPrpHQ13vWK/PnVKj2Mwt0wSCaPXsV fJGtvcvLMWSkN+Xf7cSZzR6IJcEJCb6p3k0AbB67gU7obc7ITM1wekuhwP7nO9nDiZv3 yBKNswFlh/gnN9vbvsvmBH3ntweTnWNatYGlVRbgGmMqwpXXuZcY/7O4+bSXlbvbvsIQ za3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=EIJdu6Of; 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 c65si11540092pfa.148.2019.01.20.23.20.17; Sun, 20 Jan 2019 23:20:32 -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=EIJdu6Of; 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 S1728051AbfAUHSs (ORCPT + 99 others); Mon, 21 Jan 2019 02:18:48 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:48376 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727726AbfAUHSp (ORCPT ); Mon, 21 Jan 2019 02:18:45 -0500 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190121012212epoutp03e280f04b17b8bc05005aee9332189452~7uHppCujA1972919729epoutp035 for ; Mon, 21 Jan 2019 01:22:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190121012212epoutp03e280f04b17b8bc05005aee9332189452~7uHppCujA1972919729epoutp035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548033732; bh=6N90+D9Kx4hm6L3DEeAsRZgnyLjoWOs+CamGvaVC6zM=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=EIJdu6OfqXF/nCLhHToLIGH+gGE2+FEmuxijqL31D9gHqjmF56HJ9/6TbTUKu/nl0 +HFuCw6wQFLO8/QQWJflYELd64c6eaj82akH4GN7bqiFqL+KibBPMpF5liVF9KilKv 0WHwKaJ/B1ekY2/Jhbzq1PR5e6jn5Jjt2WDbz7kI= Received: from epsmges1p1.samsung.com (unknown [182.195.40.154]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190121012209epcas1p428822eed32ba337e79c5b2dbf457c5e5~7uHmZ9M3e0422804228epcas1p4H; Mon, 21 Jan 2019 01:22:09 +0000 (GMT) X-AuditID: b6c32a35-297ff70000000fea-dd-5c451ec0a9c8 Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 21.F2.04074.0CE154C5; Mon, 21 Jan 2019 10:22:09 +0900 (KST) Mime-Version: 1.0 Subject: RE: [PATCH] PM / devfreq: fix mem leak and missing check of return value in devfreq_add_device() Reply-To: myungjoo.ham@samsung.com From: MyungJoo Ham To: Yangtao Li CC: Kyungmin Park , Chanwoo Choi , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20190119050256.22520-1-tiny.windzz@gmail.com> X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20190121012208epcms1p4a7d1132bcfb6cc86db294ae5c606aa8b@epcms1p4> Date: Mon, 21 Jan 2019 10:22:08 +0900 X-CMS-MailID: 20190121012208epcms1p4a7d1132bcfb6cc86db294ae5c606aa8b Content-Transfer-Enc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PvMs2Z2+vmCC418rvmMVlTiaU4I9FQi7moOBEAFsnZN4cDAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190119050400epcas4p34ea32277236e72d4527176fd0e98bd72 References: <20190119050256.22520-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. > > devm_kzalloc() could fail, so insert a check of its return value. And > if it fails, returns -ENOMEM. > > Signed-off-by: Yangtao Li Dear Yangtao, Could you please make your patch without indentation style changes? The label, "err_devfreq", would fit more if it's renamed "err_kzalloc". Cheers, MyungJoo.