In the implementation of alloc_rtllib() the allocated dev is leaked in
case of ieee->pHTInfo allocation failure. Release via free_netdev(dev).

Fixes: 6869a11bff1d ("Staging: rtl8192e: Use !x instead of x == NULL")
Signed-off-by: Navid Emamdoost <navid.emamdo...@gmail.com>
---
 drivers/staging/rtl8192e/rtllib_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_module.c 
b/drivers/staging/rtl8192e/rtllib_module.c
index 64d9feee1f39..18d898714c5c 100644
--- a/drivers/staging/rtl8192e/rtllib_module.c
+++ b/drivers/staging/rtl8192e/rtllib_module.c
@@ -125,7 +125,7 @@ struct net_device *alloc_rtllib(int sizeof_priv)
 
        ieee->pHTInfo = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL);
        if (!ieee->pHTInfo)
-               return NULL;
+               goto failed;
 
        HTUpdateDefaultSetting(ieee);
        HTInitializeHTInfo(ieee);
-- 
2.17.1

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to