From: Arvind Yadav Date: Tue, 13 Mar 2018 15:50:06 +0000 (+0100) Subject: net/iucv: Free memory obtained by kzalloc X-Git-Tag: v4.1.52~353 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=990d1b0d589fff0c683842e7f6e997ce12492c03;p=thirdparty%2Fkernel%2Fstable.git 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 Reviewed-by: Cornelia Huck Signed-off-by: Ursula Braun Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 123f6f9f854c6..8f9493b1bb1f2 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -2382,9 +2382,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: