Skip to contentSkip to conversation

staging: rtl8188eu: kzalloc replaced by kmalloc

PATCH In review Ivan Safonov 3 participants 4 messages Nov 8, 2015 – Feb 8, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 5/12 staging: rtl8188eu: kzalloc replaced by kmalloc

_rtl88e_fill_dummy fills the array elemets with zeros if necessary.

---
 drivers/staging/rtl8188eu/hal/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/hal/fw.c +1 -1
index 1d8930a..7f1df4d 100644
@@ -189,7 +189,7 @@ int rtl88eu_download_fw(struct adapter *adapt)
 		return -EFBIG;
 	}
 
-	pfwdata = kzalloc(FW_8188E_SIZE, GFP_KERNEL);
+	pfwdata = kmalloc(FW_8188E_SIZE, GFP_KERNEL);
 	if (!pfwdata)
 		return -ENOMEM;
 
Signature · 1 line
2.4.10
#1 lore raw
Quoted 2 lines · Ivan Safonov

_rtl88e_fill_dummy fills the array elemets with zeros if necessary.

_rtl88e_fill_dummy() fills the last sizeof(u32) or whatever so the code is aligned but it doesn't fill up to the end of FW_8188E_SIZE. Why do we even allocate that much memory. Why don't we just allocate:

	pfwdata = kmalloc(round_up(fwsize, sizeof(u32)), GFP_KERNEL);

regards,
dan carpenter

#2 lore raw
Quoted 11 lines · Dan Carpenter
Quoted 2 lines · Ivan Safonov

_rtl88e_fill_dummy fills the array elemets with zeros if necessary.

_rtl88e_fill_dummy() fills the last sizeof(u32) or whatever so the code is aligned but it doesn't fill up to the end of FW_8188E_SIZE. Why do we even allocate that much memory. Why don't we just allocate:

	pfwdata = kmalloc(round_up(fwsize, sizeof(u32)), GFP_KERNEL);

regards,
dan carpenter

Yes, it will save about 2 KB. I will correct it in the next patch.

#3 lore raw
Quoted 8 lines · Ivan Safonov
Quoted 7 lines · Dan Carpenter
Quoted 2 lines · Ivan Safonov

_rtl88e_fill_dummy fills the array elemets with zeros if necessary.

_rtl88e_fill_dummy() fills the last sizeof(u32) or whatever so the code is aligned but it doesn't fill up to the end of FW_8188E_SIZE. Why do we even allocate that much memory. Why don't we just allocate:

Quoted 6 lines
Quoted 4 lines
	pfwdata = kmalloc(round_up(fwsize, sizeof(u32)), GFP_KERNEL);

regards,
dan carpenter

Yes, it will save about 2 KB. I will correct it in the next patch.

Please send a v3 series with this fixed up.

Also, please properly thread your patches so they all show up grouped together.

thanks,

greg k-h