Received: by 10.223.185.116 with SMTP id b49csp5986221wrg; Wed, 28 Feb 2018 01:56:00 -0800 (PST) X-Google-Smtp-Source: AH8x225uG6e5OkrgRoImI6p4jZWOoOD9zrsFRL3JwZ3BW70Baeg8c3Pqj9XCr4rf94NvbEAwlq+4 X-Received: by 10.98.160.90 with SMTP id r87mr16947792pfe.151.1519811760871; Wed, 28 Feb 2018 01:56:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519811760; cv=none; d=google.com; s=arc-20160816; b=bwEUqTjg4RJekaDCjl7LbmKPsYqJjp75z85+ehEG4ZOMmReMRXrnv/8x9w1t/95Q98 F1JBwzn++DXlQbPxFwe6txlxTEOtQx4hfWlHcVKSG0OObNgLh4KiTaA6WPfVGJn3VDZc DCYf4OI111X0wVTSjCtyYnI7QjUNYeRjYg8cboeW7EJXR+iMdMrs+ioug39wihxbsYQz 8HjgtgX7bEU8MsDQgbe2JjBaq2IUaNz81jF10g8T+X4X0hDMSBI2OG1FfH4ise8pf+jg nYlfna6GLpcjkkSxQgvEiBCCaIhGE9jlOotR5kRvtmi2VPK0Jq9PeEnMHIIzyRi3CK0P 7M5w== 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=hJKZ7slCvMhrtbCqvhWEKPFkEgKGpUQEtskIUcrC7p8=; b=Fh1YW+We1KYpwSkrSAAEj5W2tzNvM5ZZCZBqd9jSGxx5gWUd/e1ldJLpkN+MqxA8iO yYTuMY2xmLUYRGVePy58I2NCFvSG5/xrVimeDzUdSRgxX7/rrK6BTeZJfFGQFHUj37KP ppAl/YCdfoukUgYe2m5yHL87myDaxKFgg2NEj7kdPLQ9N72QMJPH8/+CJ3jbVvlsTb9D NSwWe5GGngSxq0Ja801Eu68abpInErF1btJGDiwWf+za3m8d+R9D8HkvD20XSyy6Cm6q VibaDUpJRLHz4SjH6qXaSwgKhEJKM38TSv5PM8/Q129MX18W7Jyc+sLEI4pAc18Hp718 /xkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p5u2yr6n; 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 o190si804996pga.553.2018.02.28.01.55.45; Wed, 28 Feb 2018 01:56:00 -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=p5u2yr6n; 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 S1752347AbeB1Jy7 (ORCPT + 99 others); Wed, 28 Feb 2018 04:54:59 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:46403 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752082AbeB1Jy5 (ORCPT ); Wed, 28 Feb 2018 04:54:57 -0500 Received: by mail-io0-f194.google.com with SMTP id p78so2539414iod.13; Wed, 28 Feb 2018 01:54:57 -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=hJKZ7slCvMhrtbCqvhWEKPFkEgKGpUQEtskIUcrC7p8=; b=p5u2yr6nNu43ia0DPRlUw+MKrzJUZv909rBvP+fII07m+aFD4EUGQR/sf61Sv36nz7 UcAVUoDVrVM0YKaCZa3ZJGiz/u25gCpVBItxKLGpaGpial4oln1nKn+QHodttwA/unfE HuaJvLB3IJJVoVseVjZoH9dlDaovUGucy9mwPC7LQtij4zzrOOHfgTAYRkaSeH2QLzTo IQeB0fCizldXRfil0ee9k7yAINMuk403oxOvu8D3zsSDnad4+xvVyClZDdxqL71MyFQA WF2Zn4dW3uKDRTsBzmXw6uYlCoNR+9Nq3M9+h6hW6WoEJ2lNVnOWMHq3SQsheZx7iEkC DL3w== 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=hJKZ7slCvMhrtbCqvhWEKPFkEgKGpUQEtskIUcrC7p8=; b=LvqgCfen47wLVnEkkEoszEmaDKFZYVtbFj11+dCJc+t6HYSyXXwURtUy7X8anxM8CX X6pYiaDtV+Y0HoDepQIUZSy2nBbY4q7LnAJx0rwwqiCctGtQoLgsZU6OYE+hSvEJR0x/ zIZwxyRLQDvgnedicVSXFbarWJ37OahWR3vSCS1zyWp2H9PSvVgbRohBmI4ylkmkrefs 9Dzv5kqQQvESyvH42d84JC7iVdaX+sXdmyPcrmsBKFxZapDlJpjIT3P+BSSchlFll4bS GcUG6GSE42WVA8DoyNqIVf2Dm7G8mO5VkJsYQ7gzlGlp7n8wGkjgA5yEgfErqBSA7p7C zcrQ== X-Gm-Message-State: APf1xPAlX/2jh+tyICZxJUMjdx9VbWsuBE1I3sCP4D+6++afXEeBJuB1 oPuxHFduRYwVXX+YkYoMt7h4JA== X-Received: by 10.107.41.16 with SMTP id p16mr19520084iop.173.1519811696701; Wed, 28 Feb 2018 01:54:56 -0800 (PST) Received: from symbol-HP-Z420-Workstation.zebra.lan ([149.23.17.254]) by smtp.googlemail.com with ESMTPSA id r65sm1124099ioe.26.2018.02.28.01.54.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Feb 2018 01:54:55 -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] net: iucv: Free memory obtained by kzalloc Date: Wed, 28 Feb 2018 15:24:16 +0530 Message-Id: <6fbfc0b8aa75852c4eed4d05e4c165a493304ced.1519811528.git.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, if afiucv_iucv_init is not successful and removing a IUCV driver. Signed-off-by: Arvind Yadav --- net/iucv/af_iucv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 1e8cc7b..eb0995a 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: + kfree(af_iucv_dev); out_driver: driver_unregister(&af_iucv_driver); out_iucv: @@ -2496,6 +2498,7 @@ static void __exit afiucv_exit(void) { if (pr_iucv) { device_unregister(af_iucv_dev); + kfree(af_iucv_dev); driver_unregister(&af_iucv_driver); pr_iucv->iucv_unregister(&af_iucv_handler, 0); symbol_put(iucv_if); -- 1.9.1