Received: by 10.223.185.116 with SMTP id b49csp7312610wrg; Thu, 1 Mar 2018 03:33:43 -0800 (PST) X-Google-Smtp-Source: AG47ELthB4fYL/fuxzpBu6ffjnlXVgyU8gMKkzC4lfB2Kjw9qrP58rVg6Yqb30L7vV2vnKOsxL+I X-Received: by 2002:a17:902:7045:: with SMTP id h5-v6mr1653629plt.217.1519904023438; Thu, 01 Mar 2018 03:33:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519904023; cv=none; d=google.com; s=arc-20160816; b=wslmoZpU4WHNOCSn8MqCoo3qbiKSuVYaACeemm81vZwNTVzZt8IJMet6s+IX4eeOsz hSgN0/2nc3Qgofiz/cBICpyOnW884AuFRZtx2B2m8ouAUQWTsRVLhfyEAOatgMYVSe7/ /SMY8O5bS5BwyPolnq8ge0QWKacG6mrYFlx3SSY6dFCLXYZzxj71bZ1Ui6YvMB3/7DwY 2HfNM2/Ndsdp2H3+ne78AGNvNrlJjpVtJbBpTHjAXQkcMzo/dhevnpQ1oB7OYLb1ZY+J C0+w1OHjpFqlvJeXJuzjtaMq5CcH91S6KzJ4rzPEQI21WreuzOvrMeDEQFn9ilx3stK4 XCNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=bSltLOV6yk5d7AB70P7kfnRMcNXcfFNp9a5+BEocV4Q=; b=bAv3kyW7JsdrjJ8GcQgJNlbeAVw65dhVDXiyOQrjZkUnG7ylE7F9kpdg91onaAqoe3 oNEhm1p0ExmFu3PQmaAGAF5N2t+WdqnG8i6GGvVy/XmfsuoyGVVSVbpyeuSmANViiE7z pDAKi/4JYwsfQ8QJeEFVhaCwSZ7jIcmSGDcPoafVWyiBMX2sClSJ3prM5itQRphp1xGO 0tVSndKQwEahOdQhmFOGAkGAhzVil8dfE/IakTxR0/GfkBWezyw5zfoK5CGKZ9TBPEJ9 hahgC8PdwgInXrn11SayS5L7IfGioBtVaG4fb8+JTYFH9PuCN308Yk9+mEagaWpUCVIz 7DXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=edNnGq6m; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12-v6si2936139plk.256.2018.03.01.03.33.27; Thu, 01 Mar 2018 03:33:43 -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=@gmail.com header.s=20161025 header.b=edNnGq6m; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030258AbeCALcl (ORCPT + 99 others); Thu, 1 Mar 2018 06:32:41 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:36718 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967708AbeCALci (ORCPT ); Thu, 1 Mar 2018 06:32:38 -0500 Received: by mail-it0-f67.google.com with SMTP id u5so7462636itc.1; Thu, 01 Mar 2018 03:32:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=bSltLOV6yk5d7AB70P7kfnRMcNXcfFNp9a5+BEocV4Q=; b=edNnGq6mnWzZAyIbOSm4xMsckiS9dOCMm27vMcTyXMhzIAAlrYjOvkYj7ggSIlSi6a NO6k+3LVATjnpoUzlGP05aJkE+qE+f05NtGJgIGUx0ziZuFQ/fK3yizPOO657nPRf3EV iDKJunw5hfYek2RthcUVI5Hha5kD+hHrx+mmAlg6zowVooTOwiNV8DVXJkWD1MkDPSRy yLZmjt3sUDCrFl1PVWtIMRPiHheLff6ZpvEppPGgalkrRhQHqFq7cULRwkOLbdebNo1+ FqqlpOaayJeuBVkEqddNL41+iD1cF1/otP5y/tmG4mlMrdBql19N4I0Wj4Zk6ITqkU3H 1PPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bSltLOV6yk5d7AB70P7kfnRMcNXcfFNp9a5+BEocV4Q=; b=oJYIaoLtE+Xk7WYdsm+qky1jrhw+1A/CNA1Lo4PrxOCVuaJ0NKdowUH11k6mIMTYQV AQD6NQh/7IDhS6x22dGR9cmBwCPz2ZjnZJB5FyLh95/Uo1wKkC2pXly+d7SsfejsMISd MUo0clKMGyAuNIhvat7uJAxf7C79DEs40PS+9irxg/g/ujpaCmTsXDwXRgJEbpb9/7Yh 4p6yB2v0VM3HjgsE3WaXkQSUbDmWDuxp2AzWZENFAedBy1vF7tzMHI3txNG2S/9RjilQ HNJpIzqgyFP9ZKTs6oNtQQnG5OwnxM8kNAifSo+ZxhoEd72lpsnlWnXhQVNL1WNaXbsV Vh0w== X-Gm-Message-State: AElRT7G9AGmBzdU8+UDRj8oQMFxBT/7BlCt6P4RDGhNLBXzPQzmYTwLv yN9PXgl9mTUEhA9huaZWTbDVkg== X-Received: by 10.36.95.140 with SMTP id r134mr1055426itb.70.1519903958271; Thu, 01 Mar 2018 03:32:38 -0800 (PST) Received: from symbol-HP-Z420-Workstation.zebra.lan ([149.23.17.254]) by smtp.googlemail.com with ESMTPSA id j28sm2923349ioo.63.2018.03.01.03.32.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 03:32:37 -0800 (PST) From: Arvind Yadav To: jwi@linux.vnet.ibm.com, ubraun@linux.vnet.ibm.com, davem@davemloft.net Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v3] net: iucv: Free memory obtained by kzalloc Date: Thu, 1 Mar 2018 17:01:57 +0530 Message-Id: <1519903917-11575-1-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Free memory by calling put_device(), if afiucv_iucv_init is not successful. Signed-off-by: Arvind Yadav --- changes in v2: Calling put_device() before kfree(). changes in v3: No need to call kfree(). So removed kfree(). net/iucv/af_iucv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 1e8cc7b..9e2643a 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -2433,9 +2433,11 @@ static int afiucv_iucv_init(void) af_iucv_dev->driver = &af_iucv_driver; err = device_register(af_iucv_dev); if (err) - goto out_driver; + goto out_iucv_dev; return 0; +out_iucv_dev: + put_device(af_iucv_dev); out_driver: driver_unregister(&af_iucv_driver); out_iucv: -- 1.9.1