Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2844233yba; Mon, 22 Apr 2019 14:07:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXzOeJCdP6TZjA7auZIufJguX/7HDPi7LRmtNjsJTcCBncdL9S1p0T2pXeKbBu8oAGQbO+ X-Received: by 2002:a17:902:bb90:: with SMTP id m16mr22650373pls.340.1555967262026; Mon, 22 Apr 2019 14:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555967262; cv=none; d=google.com; s=arc-20160816; b=ARu0clUCJdmkNY/EP6Vu/NsnKMlFx3M6BeAOML2OQsTK9oSwIz9R1FPBFFUA0jXs1B CLsIT4MLpfGyydcv5u/KS5UcXQL5zTEcI08dqIll2pTg3AsyUymkfLBFFA+ZZlQR3Q26 aPUy9k4cc8X0CLvZUfUKvZqpPlN5oIsN4vWTrGZebZDacrFlQGhjlVr+B6LZ3XkMnLkf McnMnvq/QN0JZRlrJJ9IpqkWsZgxXNVS8QA9AEo02EtwU5Uk/zfd1h5DaSDZEZ2Nz5iD moJrnxylsjs9mb0XM7P1m/maA+yGorRu0yIiJaVbI8xl0ek9UOyeAuykbYSo3KbFNrG/ Z+qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5MlBHA+JNjysp6eQmNBESXeECWfLM5kfgBkaU1MwWtE=; b=SWKmWFzFLdHPT5Gix4hPKgBW0+z3L07e1n9oIi1eim4G0wE5BNnBo0SJ7aYD337KKt 53CygmIUb4EPV6UTq+AIre7QQrxQDmjs/GMHAyEWH4EkH2lnBbIgAzeYCSGT+5kwBqQE hBEIvTzhTTQvOSbuPj3NC3cWR/CdXyFECCZNnJ4AN2g4WwkSJFi25Otj4iNm7+gpGDzh I8SWw54Fa+BFqdFaUt94nJ91w1kP4oY1gPprVGMPtL8IZGqOrrCmxASkYkJDH9T44F4H S6fr2YW/Rzonc46vDutke+RRoaJ6IBTlWQsAg5HmfqQsXlhLRxQ7iHfC63iOgOqDUdxq dTpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O5G1IaSy; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si14050054plt.119.2019.04.22.14.07.27; Mon, 22 Apr 2019 14:07:42 -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=@kernel.org header.s=default header.b=O5G1IaSy; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730080AbfDVTqr (ORCPT + 99 others); Mon, 22 Apr 2019 15:46:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:49118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730055AbfDVTqp (ORCPT ); Mon, 22 Apr 2019 15:46:45 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B9601218FF; Mon, 22 Apr 2019 19:46:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962404; bh=+k+o2ok35qIOJqYoebmTJFG/yzV9ffoigKvIExKuR7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O5G1IaSyEn6LFIhBYTUPUN71mMi/a+qU7ATx5JDoFb+BLjE89YYwt7DefMsZfgMo7 CSt7LtoufGJm5TiHmUk+m6y4AWp1h52pnCyMXm6eZEzqtMdZTV0B0icy0stlY6Sgql cRN3LBzoYH4NWSUMRcaVTd6Kvesx/tKYgTB0zlRM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wen Yang , Douglas Miller , "David S. Miller" , netdev@vger.kernel.org, Sasha Levin Subject: [PATCH AUTOSEL 4.19 41/68] net: ibm: fix possible object reference leak Date: Mon, 22 Apr 2019 15:44:49 -0400 Message-Id: <20190422194516.11634-41-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194516.11634-1-sashal@kernel.org> References: <20190422194516.11634-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wen Yang [ Upstream commit be693df3cf9dd113ff1d2c0d8150199efdba37f6 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin (Microsoft) --- 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 03f64f40b2a3..506f78322d74 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c @@ -3161,6 +3161,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.19.1