Received: by 10.213.65.68 with SMTP id h4csp2271233imn; Thu, 29 Mar 2018 22:53:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/hHA3b+09psb6BEziRYpqiRryUpbt93dcTtkeDVk6JWf5uxF03zYHQ7oMM6200WW1bDpQJ X-Received: by 2002:a17:902:24:: with SMTP id 33-v6mr11538865pla.341.1522389235762; Thu, 29 Mar 2018 22:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522389235; cv=none; d=google.com; s=arc-20160816; b=PFzh8089MSLzh1fuUb/xFYnXmrSfQnpASIXmME9fKuYaN5GlCHgNkBxAQLMrFltIvU mpU+8KCdYZcWMKQEg+eibNK5BWuWvkKR5cub2Eic3jEdswzf3szhqAOP/exkVewe/ILH SG3Rt2axm9+o0gdiAuGTijMWpaU7EIL2ItoCezo0qLF+FbsIiSAkSjVmqB27msJt+Vcg SK6MlrxPly+HaScSZ1k/HDA9xUo7gKzNDIFjrYLdY1Ei2o8dRTRCyjjYxpSry23W+Elr hLFOC5TxekVJMHZAsF3O6lk/zqJjidhf9zKz5A5z6UDq2vthk3Dyn536oxr9iWDBCO1g O+TA== 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 :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter:arc-authentication-results; bh=VTlf2FXCmLVXIvoqtj1zSJS30fLkcG9pK6pHuQYW3Ts=; b=h0xiHPW0GgGvspAW/jh7LX4xPN1swmp73MqOmVX7651GIPWx743C1pnaZryhKo6pCf 47t9xCFSLfdN7TayU3P/aG1ND3TQEtZwF+qFmn+fmUATYcSn3CIEXjC/NkEX3YvOfXOX dianEdOU7jHQqhCgVLub5XPCyiF9vqetYAjZNgft4H00Ao5Kv1GVylvGITEt7cc8zoav N4RKIrxFbpw74eatvUZdQYm4Mu2KNVXAIHR2kuT7GkoG6Zrmpynj+dUiqo47zoRvTpTB ILPwRCvBcmXK++dQe7BJLK2NvRFeRFTDzSIIM7wMQmvgU5Vy4/9Ch0ZD+nnwMnrmHQ8j pVRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=cZiQbwkQ; 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 126si5157005pgd.375.2018.03.29.22.53.41; Thu, 29 Mar 2018 22:53:55 -0700 (PDT) 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=cZiQbwkQ; 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 S1751473AbeC3Fw0 (ORCPT + 99 others); Fri, 30 Mar 2018 01:52:26 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:19269 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750794AbeC3FwO (ORCPT ); Fri, 30 Mar 2018 01:52:14 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20180330055212epoutp03394d54b41c733b8f1c5bffcb778ae272~gnNmQLDeF2026120261epoutp03n; Fri, 30 Mar 2018 05:52:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20180330055212epoutp03394d54b41c733b8f1c5bffcb778ae272~gnNmQLDeF2026120261epoutp03n DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1522389132; bh=VTlf2FXCmLVXIvoqtj1zSJS30fLkcG9pK6pHuQYW3Ts=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=cZiQbwkQ7gzjUmDXrDMFnSqEjjIJpkvNlYuIA99AxvywVOLiRb0RQucjDpPJnbTrd TDDs30K9b4XV1Zt4FucO+YU44VCLYLdTZ8etHtiqZFlJ38ionMlztnQHGFDX1X1z8G r+bV9e3ILEd1NDO6y8T/kfPwB2AhiXxa433Cp4OY= Received: from epsmges2p2.samsung.com (unknown [182.195.40.61]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20180330055212epcas1p1f60170c4304467bf62f1c1173b803976~gnNl_9WSm1555415554epcas1p1c; Fri, 30 Mar 2018 05:52:12 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id BA.A4.04072.B80DDBA5; Fri, 30 Mar 2018 14:52:11 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20180330055211epcas2p1a75c707cdf600cfd5027e253ef440861~gnNlhTLLX0392803928epcas2p1X; Fri, 30 Mar 2018 05:52:11 +0000 (GMT) X-AuditID: b6c32a46-b85ff70000000fe8-da-5abdd08b2f58 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 14.6F.03827.B80DDBA5; Fri, 30 Mar 2018 14:52:11 +0900 (KST) Received: from localhost.localdomain ([10.253.107.61]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P6E00F9Y2YNM660@mmp2.samsung.com>; Fri, 30 Mar 2018 14:52:11 +0900 (KST) From: Ji-Hun Kim To: gregkh@linuxfoundation.org, baijiaju1990@gmail.com, forest@alittletooquiet.net Cc: dartnorris@gmail.com, santhameena13@gmail.com, julia.lawall@lip6.fr, ji_hun.kim@samsung.com, y.k.oh@samsung.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH v4 2/2] staging: vt6655: add handling memory leak on vnt_start() Date: Fri, 30 Mar 2018 14:51:55 +0900 Message-id: <1522389115-1124-2-git-send-email-ji_hun.kim@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1522389115-1124-1-git-send-email-ji_hun.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKKsWRmVeSWpSXmKPExsWy7bCmqW73hb1RBvuvWlusm7iQyeLM+7NM FnvO/GK3uD/hEatF8+L1bBb9p7czWix7cJrRYustaYvLu+awWZzcJm+xpesHqwO3R3Pje1aP e/sOs3jsnHWX3WP/3DXsHnu3ZHn0bVnF6PF5k1wAe1SqTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8 c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7QhUoKZYk5pUChgMTiYiV9O5ui/NKSVIWM/OIS W6VoQ0MjPUMDcz0jIyM9E/NYKyNToJKE1IxXXS9YC3p4KnZM+c3awNjA1cXIySEhYCLxbH4P axcjF4eQwA5Gibc/+5ghnO+MEjvanzDCVB29chmqagOjxPcnq9kgnB+MEut//WIHqWIT0JTY 2H0NrENEIERixY5tLCBFzAKXGCUWr13JDJIQFgiS2P3uExOIzSKgKrHx2TSwBl4BV4mZ61+z QayTkzh5bDIriM0p4Cax8uwfsNUSAhvYJHqXfGaCKHKReL7/PNR9whKvjm9hh7ClJZ6t2ggV r5ZYcGUHC4RdI3Hz/1KoXmOJ3p4LYAcxC/BJdBz+C9TLARTnlehoE4Io8ZC4N78daoyjxN7t M1ggPp7JKDHjdA/TBEapBYwMqxjFUguKc9NTi40KjPSKE3OLS/PS9ZLzczcxgpOQltsOxiXn fA4xCnAwKvHwKrDsjRJiTSwrrsw9xCjBwaw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PRUIu5qDgRACsOlvA7AgAA X-CMS-MailID: 20180330055211epcas2p1a75c707cdf600cfd5027e253ef440861 X-Msg-Generator: CA CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180330055211epcas2p1a75c707cdf600cfd5027e253ef440861 X-RootMTR: 20180330055211epcas2p1a75c707cdf600cfd5027e253ef440861 References: <1522389115-1124-1-git-send-email-ji_hun.kim@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There was no code for handling memory leaks of device_init_rings() and request_irq(). It needs to free allocated memory in the device_init_rings() , when request_irq() is failed. Add freeing sequences of irq and device init rings. Signed-off-by: Ji-Hun Kim --- It's additional memory leak handling patch from [PATCH v4 1/2] staging: vt6655: check for memory allocation failures drivers/staging/vt6655/device_main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index c9752df..3604f2d 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -1194,14 +1194,17 @@ static int vnt_start(struct ieee80211_hw *hw) int ret; priv->rx_buf_sz = PKT_BUF_SZ; - if (!device_init_rings(priv)) - return -ENOMEM; + ret = (int)device_init_rings(priv); + if (!ret) { + ret = -ENOMEM; + goto err_init_rings; + } ret = request_irq(priv->pcid->irq, vnt_interrupt, IRQF_SHARED, "vt6655", priv); if (ret) { dev_dbg(&priv->pcid->dev, "failed to start irq\n"); - return ret; + goto err_irq; } dev_dbg(&priv->pcid->dev, "call device init rd0 ring\n"); @@ -1234,6 +1237,10 @@ static int vnt_start(struct ieee80211_hw *hw) err_init_rd1_ring: device_free_rd0_ring(priv); err_init_rd0_ring: + free_irq(priv->pcid->irq, priv); +err_irq: + device_free_rings(priv); +err_init_rings: return ret; } -- 1.9.1