Commit fa6a91e9 authored by Arvind Yadav's avatar Arvind Yadav Committed by David S. Miller

net/iucv: Free memory obtained by kzalloc

Free memory by calling put_device(), if afiucv_iucv_init is not
successful.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 484d802d
...@@ -2433,9 +2433,11 @@ static int afiucv_iucv_init(void) ...@@ -2433,9 +2433,11 @@ static int afiucv_iucv_init(void)
af_iucv_dev->driver = &af_iucv_driver; af_iucv_dev->driver = &af_iucv_driver;
err = device_register(af_iucv_dev); err = device_register(af_iucv_dev);
if (err) if (err)
goto out_driver; goto out_iucv_dev;
return 0; return 0;
out_iucv_dev:
put_device(af_iucv_dev);
out_driver: out_driver:
driver_unregister(&af_iucv_driver); driver_unregister(&af_iucv_driver);
out_iucv: out_iucv:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment