[patch] wlan-ng: initialise mibitem

From: Simon Horman
Date: Sun Dec 20 2009 - 23:10:00 EST


$ gcc --version

gcc (Debian 4.4.2-5) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make
...
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_dorequestâ:
drivers/staging/wlan-ng/p80211wext.c:139: warning: âmibitem.lenâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:139: warning: âmibitem.statusâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_giwretryâ:
drivers/staging/wlan-ng/p80211wext.c:967: warning: âmibitem.lenâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:967: warning: âmibitem.statusâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:967: warning: âmibitem.dataâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_siwretryâ:
drivers/staging/wlan-ng/p80211wext.c:1057: warning: âmibitem.lenâ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:1057: warning: âmibitem.statusâ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_giwtxpowâ:
drivers/staging/wlan-ng/p80211wext.c:1149: warning: âmibitem.lenâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:1149: warning: âmibitem.statusâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:1149: warning: âmibitem.dataâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_siwtxpowâ:
drivers/staging/wlan-ng/p80211wext.c:1123: warning: âmibitem.lenâ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:1123: warning: âmibitem.statusâ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_giwfragâ:
drivers/staging/wlan-ng/p80211wext.c:891: warning: âmibitem.lenâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:891: warning: âmibitem.statusâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:891: warning: âmibitem.dataâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_siwfragâ:
drivers/staging/wlan-ng/p80211wext.c:933: warning: âmibitem.lenâ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:933: warning: âmibitem.statusâ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_giwrtsâ:
drivers/staging/wlan-ng/p80211wext.c:826: warning: âmibitem.lenâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:826: warning: âmibitem.statusâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:826: warning: âmibitem.dataâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_siwrtsâ:
drivers/staging/wlan-ng/p80211wext.c:866: warning: âmibitem.lenâ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:866: warning: âmibitem.statusâ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_giwrateâ:
drivers/staging/wlan-ng/p80211wext.c:775: warning: âmibitem.lenâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:775: warning: âmibitem.statusâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:775: warning: âmibitem.dataâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_giwfreqâ:
drivers/staging/wlan-ng/p80211wext.c:273: warning: âmibitem.lenâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:273: warning: âmibitem.statusâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:273: warning: âmibitem.dataâ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_siwfreqâ:
drivers/staging/wlan-ng/p80211wext.c:320: warning: âmibitem.lenâ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function âp80211wext_siwmodeâ:
drivers/staging/wlan-ng/p80211wext.c:401: warning: âmibitem.lenâ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:401: warning: âmibitem.statusâ may be used uninitialized in this function
...

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: net-next-2.6/drivers/staging/wlan-ng/p80211wext.c
===================================================================
--- net-next-2.6.orig/drivers/staging/wlan-ng/p80211wext.c 2009-12-21 13:26:39.000000000 +1100
+++ net-next-2.6/drivers/staging/wlan-ng/p80211wext.c 2009-12-21 13:26:42.000000000 +1100
@@ -134,6 +134,7 @@ static int p80211wext_dorequest(wlandevi
int result;

msg.msgcode = DIDmsg_dot11req_mibset;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did = did;
mibitem.data = data;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
@@ -269,6 +270,7 @@ static int p80211wext_giwfreq(netdevice_
int err = 0;

msg.msgcode = DIDmsg_dot11req_mibget;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did = DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg);
@@ -309,6 +311,7 @@ static int p80211wext_siwfreq(netdevice_
}

msg.msgcode = DIDmsg_dot11req_mibset;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did = DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel;
mibitem.status = P80211ENUM_msgitem_status_data_ok;

@@ -396,6 +399,7 @@ static int p80211wext_siwmode(netdevice_

/* Set Operation mode to the PORT TYPE RID */
msg.msgcode = DIDmsg_dot11req_mibset;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did = DIDmib_p2_p2Static_p2CnfPortType;
mibitem.data = (*mode == IW_MODE_ADHOC) ? 0 : 1;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
@@ -771,6 +775,7 @@ static int p80211wext_giwrate(netdevice_
int err = 0;

msg.msgcode = DIDmsg_dot11req_mibget;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did = DIDmib_p2_p2MAC_p2CurrentTxRate;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg);
@@ -822,6 +827,7 @@ static int p80211wext_giwrts(netdevice_t
int err = 0;

msg.msgcode = DIDmsg_dot11req_mibget;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
result = p80211req_dorequest(wlandev, (u8 *) & msg);
@@ -857,6 +863,7 @@ static int p80211wext_siwrts(netdevice_t
}

msg.msgcode = DIDmsg_dot11req_mibget;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold;
if (rts->disabled)
mibitem.data = 2347;
@@ -886,6 +893,7 @@ static int p80211wext_giwfrag(netdevice_
int err = 0;

msg.msgcode = DIDmsg_dot11req_mibget;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did =
DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold;
memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
@@ -922,6 +930,7 @@ static int p80211wext_siwfrag(netdevice_
}

msg.msgcode = DIDmsg_dot11req_mibset;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did =
DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold;

@@ -962,6 +971,7 @@ static int p80211wext_giwretry(netdevice
u16 shortretry, longretry, lifetime;

msg.msgcode = DIDmsg_dot11req_mibget;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit;

memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
@@ -1037,6 +1047,8 @@ static int p80211wext_siwretry(netdevice
int result;
int err = 0;

+ memset(&mibitem, 0, sizeof(mibitem));
+
if (!wlan_wext_write) {
err = (-EOPNOTSUPP);
goto exit;
@@ -1114,6 +1126,7 @@ static int p80211wext_siwtxpow(netdevice
}

msg.msgcode = DIDmsg_dot11req_mibset;
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did =
DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel;
if (rrq->fixed == 0)
@@ -1143,6 +1156,8 @@ static int p80211wext_giwtxpow(netdevice
int err = 0;

msg.msgcode = DIDmsg_dot11req_mibget;
+
+ memset(&mibitem, 0, sizeof(mibitem));
mibitem.did =
DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/