summaryrefslogtreecommitdiff
path: root/net/iucv
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2018-03-13 18:50:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-08 12:49:42 +0300
commita6ca1eddd279cb9bebf83f4473e347a540f3b442 (patch)
tree4fc25e52a83853dd86e0b8c900b74768b0f23b56 /net/iucv
parentaab60f194f488d9598067919e38e0c8633117b02 (diff)
downloadlinux-a6ca1eddd279cb9bebf83f4473e347a540f3b442.tar.xz
net/iucv: Free memory obtained by kzalloc
[ Upstream commit fa6a91e9b907231d2e38ea5ed89c537b3525df3d ] Free memory by calling put_device(), if afiucv_iucv_init is not successful. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/iucv')
-rw-r--r--net/iucv/af_iucv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index a089b6b91650..8f4a74910b7c 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -2383,9 +2383,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: