Skip to contentSkip to conversation

Staging: rtl8192e: rtllib_softmac: Do not print message if kzalloc() failed.

PATCH In review Sandhya Bankar 2 participants 2 messages Mar 6, 2016 – Mar 11, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: rtl8192e: rtllib_softmac: Do not print message if kzalloc() failed.

As kzalloc() has its own messges, so no need of error messsge after kzalloc() failed . Also removing the NULL test whose purpose is to print the error message only and not returning any error.

---
Changes in v2:
* No change.
*Compile this patch to check nothing is broken.

 drivers/staging/rtl8192e/rtllib_softmac.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8192e/rtllib_softmac.c +0 -2
index 25b5b5e..0c891c8 100644
@@ -2980,8 +2980,6 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
 	for (i = 0; i < 5; i++)
 		ieee->seq_ctrl[i] = 0;
 	ieee->pDot11dInfo = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC);
-	if (!ieee->pDot11dInfo)
-		netdev_err(ieee->dev, "Can't alloc memory for DOT11D\n");
 	ieee->LinkDetectInfo.SlotIndex = 0;
 	ieee->LinkDetectInfo.SlotNum = 2;
 	ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0;
Signature · 1 line
1.8.3.4
maintainer
#1 lore raw
Quoted 1 line · Sandhya Bankar

As kzalloc() has its own messges, so no need of error messsge after kzalloc() failed . Also removing the NULL test whose purpose is to print the error message only and not returning any error.

Please wrap this changelog entry :(

Quoted 15 lines

---
Changes in v2:
* No change.
*Compile this patch to check nothing is broken.

 drivers/staging/rtl8192e/rtllib_softmac.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8192e/rtllib_softmac.c +0 -0
index 25b5b5e..0c891c8 100644

drivers/staging/rtl8192e/rtllib_softmac.c void rtllib_softmac_init(struct rtllib_device *ieee) · line 2984

Quoted 5 lines
drivers/staging/rtl8192e/rtllib_softmac.c +0 -2
@@ -2980,8 +2980,6 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
 	for (i = 0; i < 5; i++)
 		ieee->seq_ctrl[i] = 0;
 	ieee->pDot11dInfo = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC);
-	if (!ieee->pDot11dInfo)
-		netdev_err(ieee->dev, "Can't alloc memory for DOT11D\n");

Don't you think some error should happen here? We can't just continue on like nothing happened...

thanks,

greg k-h