1
0
Fork 0

net/iucv: Free memory obtained by kzalloc

[ Upstream commit fa6a91e9b9 ]

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>
pull/10/head
Arvind Yadav 2018-03-13 16:50:06 +01:00 committed by Greg Kroah-Hartman
parent a14b791d98
commit 2980f37b61
1 changed files with 3 additions and 1 deletions

View File

@ -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: