Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-modules-rtl8723au: Commit

external/modules/rtl8723au


Commit MetaInfo

Revisiond1a70f32dd661ecf30d2e48633a48ce17f866253 (tree)
Time2014-01-10 06:56:50
AuthorLarry Finger <Larry.Finger@lwfi...>
CommiterLarry Finger

Log Message

rtl8723au: Fix Smatch warnings in core/rtw_xmit.c

Smatch reports the following:

CHECK /home/finger/rtl8723au/core/rtw_xmit.c

/home/finger/rtl8723au/core/rtw_xmit.c:2068 rtw_alloc_hwxmits() error: buffer overflow 'hwxmits' 4 <= 4

This results from an off-by-one error.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>

Change Summary

Incremental Difference

--- a/core/rtw_xmit.c
+++ b/core/rtw_xmit.c
@@ -2563,10 +2563,12 @@ void rtw_alloc_hwxmits(struct rtw_adapter *padapter)
25632563 {
25642564 struct hw_xmit *hwxmits;
25652565 struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
2566+ int size;
25662567
25672568 pxmitpriv->hwxmit_entry = HWXMIT_ENTRY;
25682569
2569- pxmitpriv->hwxmits = (struct hw_xmit *)rtw_zmalloc(sizeof (struct hw_xmit) * pxmitpriv->hwxmit_entry);
2570+ size = sizeof(struct hw_xmit) * (pxmitpriv->hwxmit_entry + 1);
2571+ pxmitpriv->hwxmits = kzalloc(size, GFP_KERNEL);
25702572
25712573 hwxmits = pxmitpriv->hwxmits;
25722574
Show on old repository browser