Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp272772img; Thu, 21 Mar 2019 20:06:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwn43U4hB63a7TbQPXgP/OMihBJFM5NTwZtCLb7kfzWjAPnrJmgfFe/s//ioe4RoASUg3Cf X-Received: by 2002:a17:902:f089:: with SMTP id go9mr7268929plb.335.1553223964303; Thu, 21 Mar 2019 20:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553223964; cv=none; d=google.com; s=arc-20160816; b=S0yVLhh0VN7dlpAAumh4PEJw0ITBaAlGEFhoSJP2B0z9pOPBbVjXCmxMcXdYwP2P+/ QA38owcj+AmgE1PwY+7IeFDRnbL8TElPGV/k9wztW4CcCCD3ryGKZ13/cPDcxWPryXk5 TKFr3tijez9hyyc6xZEDaNsB2ZYSuT8E2trvN9+mvv+MhQK1Jr6PeNO55F9A2RPqKXjD BZRt9BtfcnlDaxGfyz/Ps6DVpb8UI5WOEN8tXhNsXj8zOXEy7U49j4pZvtPwdmnxDvpA l7BLhTjIu7xwah7uijdAv3eXdEoMxYX8SevM2pMQr8xq/jZGTdWvw1xkKr4EF7wvfnsl +sbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=N6NDurncGeUP/iXTRHseOtPU91ok7FJxf4a+8MKs46M=; b=QFU9E6QFHNwEJjzr9A8Y896qIQEtII7N3dCGjGYbu+4mlJXK2ekx59bcZ6s2OMLkP5 oJ2jN4NgaX+P3Vt/+q0mFNtrZFKPO5kWUYTx5ccvvbPuLX9Zx71P9qnwfalcW3avHTwb /dgwunpYRrqDJYzfaR9chCL51MPqXzGyxHGhJM1mSK7mxgqypGJTupsDL/LUI6tbNt9+ QRHi3Eqjz31fgJwkJmZIaPTtB2xtVALFbER/czgXn4lsaK8Ls6nX2pmydymVRM/ruhwq fkGuyQ6cRziAQAS6o562rXQTy1k6WpyrHc02jUclFpq28OPqL9yG+cNzw8UTk09DfBCn 9F/A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x20si5423459pfm.282.2019.03.21.20.05.49; Thu, 21 Mar 2019 20:06:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727584AbfCVDFF (ORCPT + 99 others); Thu, 21 Mar 2019 23:05:05 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:36228 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727516AbfCVDFB (ORCPT ); Thu, 21 Mar 2019 23:05:01 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 093FB6F3DF57131869B0; Fri, 22 Mar 2019 11:05:00 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x2M344Kn071305; Fri, 22 Mar 2019 11:04:04 +0800 (GMT-8) (envelope-from wen.yang99@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 2019032211044053-5922612 ; Fri, 22 Mar 2019 11:04:40 +0800 From: Wen Yang To: linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Wen Yang , Douglas Miller , "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH 2/3] net: ibm: fix possible object reference leak Date: Fri, 22 Mar 2019 11:04:08 +0800 Message-Id: <1553223849-7143-2-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1553223849-7143-1-git-send-email-wen.yang99@zte.com.cn> References: <1553223849-7143-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-22 11:04:40, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-22 11:03:49, Serialize complete at 2019-03-22 11:03:49 X-MAIL: mse01.zte.com.cn x2M344Kn071305 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to ehea_get_eth_dn returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./drivers/net/ethernet/ibm/ehea/ehea_main.c:3163:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 3154, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Douglas Miller Cc: "David S. Miller" Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/ibm/ehea/ehea_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 3baabdc..90b62c1 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c @@ -3160,6 +3160,7 @@ static ssize_t ehea_probe_port(struct device *dev, if (ehea_add_adapter_mr(adapter)) { pr_err("creating MR failed\n"); + of_node_put(eth_dn); return -EIO; } -- 2.9.5