aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/wext.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2009-10-08 22:38:45 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:47:55 -0400
commitc0bbd57679efc2350703a1c0f3fc624cbcaba55f (patch)
tree9d7abd3b727fd64c9ccf782277ce90a6656f861a /drivers/net/wireless/libertas/wext.c
parentbe823e5b2d71d367b5e27496e2b19d453e21936e (diff)
libertas: Check return status of command functions
Return status of lbs_prepare_and_send_command and lbs_cmd_with_response functions is not checked at some places. Those checks are added. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/wext.c')
-rw-r--r--drivers/net/wireless/libertas/wext.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 69dd19bf9558..4594841cd4af 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -832,7 +832,7 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
832 u32 rssi_qual; 832 u32 rssi_qual;
833 u32 tx_qual; 833 u32 tx_qual;
834 u32 quality = 0; 834 u32 quality = 0;
835 int stats_valid = 0; 835 int ret, stats_valid = 0;
836 u8 rssi; 836 u8 rssi;
837 u32 tx_retries; 837 u32 tx_retries;
838 struct cmd_ds_802_11_get_log log; 838 struct cmd_ds_802_11_get_log log;
@@ -881,7 +881,9 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
881 881
882 memset(&log, 0, sizeof(log)); 882 memset(&log, 0, sizeof(log));
883 log.hdr.size = cpu_to_le16(sizeof(log)); 883 log.hdr.size = cpu_to_le16(sizeof(log));
884 lbs_cmd_with_response(priv, CMD_802_11_GET_LOG, &log); 884 ret = lbs_cmd_with_response(priv, CMD_802_11_GET_LOG, &log);
885 if (ret)
886 goto out;
885 887
886 tx_retries = le32_to_cpu(log.retry); 888 tx_retries = le32_to_cpu(log.retry);
887 889
@@ -909,8 +911,10 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
909 stats_valid = 1; 911 stats_valid = 1;
910 912
911 /* update stats asynchronously for future calls */ 913 /* update stats asynchronously for future calls */
912 lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, 914 ret = lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0,
913 0, 0, NULL); 915 0, 0, NULL);
916 if (ret)
917 lbs_pr_err("RSSI command failed\n");
914out: 918out:
915 if (!stats_valid) { 919 if (!stats_valid) {
916 priv->wstats.miss.beacon = 0; 920 priv->wstats.miss.beacon = 0;