Skip to content

Commit 9373771

Browse files
rddunlapkuba-moo
authored andcommitted
wifi: airo: avoid uninitialized warning in airo_get_rate()
Quieten a gcc (11.3.0) build error or warning by checking the function call status and returning -EBUSY if the function call failed. This is similar to what several other wireless drivers do for the SIOCGIWRATE ioctl call when there is a locking problem. drivers/net/wireless/cisco/airo.c: error: 'status_rid.currentXmitRate' is used uninitialized [-Werror=uninitialized] Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Randy Dunlap <[email protected]> Reported-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8278ee2 commit 9373771

File tree

1 file changed

+4
-1
lines changed
  • drivers/net/wireless/cisco

1 file changed

+4
-1
lines changed

drivers/net/wireless/cisco/airo.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6157,8 +6157,11 @@ static int airo_get_rate(struct net_device *dev,
61576157
struct iw_param *vwrq = &wrqu->bitrate;
61586158
struct airo_info *local = dev->ml_priv;
61596159
StatusRid status_rid; /* Card status info */
6160+
int ret;
61606161

6161-
readStatusRid(local, &status_rid, 1);
6162+
ret = readStatusRid(local, &status_rid, 1);
6163+
if (ret)
6164+
return -EBUSY;
61626165

61636166
vwrq->value = le16_to_cpu(status_rid.currentXmitRate) * 500000;
61646167
/* If more than one rate, set auto */

0 commit comments

Comments
 (0)