diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/init.c')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/init.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index 6ae0734f86e0..da557dc742e6 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c | |||
@@ -954,8 +954,10 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name) | |||
954 | snprintf(filename, sizeof(filename), "%s/%s", ar->hw.fw.dir, name); | 954 | snprintf(filename, sizeof(filename), "%s/%s", ar->hw.fw.dir, name); |
955 | 955 | ||
956 | ret = request_firmware(&fw, filename, ar->dev); | 956 | ret = request_firmware(&fw, filename, ar->dev); |
957 | if (ret) | 957 | if (ret) { |
958 | ath6kl_err("Failed request firmware, rv: %d\n", ret); | ||
958 | return ret; | 959 | return ret; |
960 | } | ||
959 | 961 | ||
960 | data = fw->data; | 962 | data = fw->data; |
961 | len = fw->size; | 963 | len = fw->size; |
@@ -964,11 +966,15 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name) | |||
964 | magic_len = strlen(ATH6KL_FIRMWARE_MAGIC) + 1; | 966 | magic_len = strlen(ATH6KL_FIRMWARE_MAGIC) + 1; |
965 | 967 | ||
966 | if (len < magic_len) { | 968 | if (len < magic_len) { |
969 | ath6kl_err("Magic length is invalid, len: %zd magic_len: %zd\n", | ||
970 | len, magic_len); | ||
967 | ret = -EINVAL; | 971 | ret = -EINVAL; |
968 | goto out; | 972 | goto out; |
969 | } | 973 | } |
970 | 974 | ||
971 | if (memcmp(data, ATH6KL_FIRMWARE_MAGIC, magic_len) != 0) { | 975 | if (memcmp(data, ATH6KL_FIRMWARE_MAGIC, magic_len) != 0) { |
976 | ath6kl_err("Magic is invalid, magic_len: %zd\n", | ||
977 | magic_len); | ||
972 | ret = -EINVAL; | 978 | ret = -EINVAL; |
973 | goto out; | 979 | goto out; |
974 | } | 980 | } |
@@ -987,7 +993,12 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name) | |||
987 | len -= sizeof(*hdr); | 993 | len -= sizeof(*hdr); |
988 | data += sizeof(*hdr); | 994 | data += sizeof(*hdr); |
989 | 995 | ||
996 | ath6kl_dbg(ATH6KL_DBG_BOOT, "ie-id: %d len: %zd (0x%zx)\n", | ||
997 | ie_id, ie_len, ie_len); | ||
998 | |||
990 | if (len < ie_len) { | 999 | if (len < ie_len) { |
1000 | ath6kl_err("IE len is invalid, len: %zd ie_len: %zd ie-id: %d\n", | ||
1001 | len, ie_len, ie_id); | ||
991 | ret = -EINVAL; | 1002 | ret = -EINVAL; |
992 | goto out; | 1003 | goto out; |
993 | } | 1004 | } |
@@ -1008,6 +1019,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name) | |||
1008 | ar->fw_otp = kmemdup(data, ie_len, GFP_KERNEL); | 1019 | ar->fw_otp = kmemdup(data, ie_len, GFP_KERNEL); |
1009 | 1020 | ||
1010 | if (ar->fw_otp == NULL) { | 1021 | if (ar->fw_otp == NULL) { |
1022 | ath6kl_err("fw_otp cannot be allocated\n"); | ||
1011 | ret = -ENOMEM; | 1023 | ret = -ENOMEM; |
1012 | goto out; | 1024 | goto out; |
1013 | } | 1025 | } |
@@ -1025,6 +1037,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name) | |||
1025 | ar->fw = vmalloc(ie_len); | 1037 | ar->fw = vmalloc(ie_len); |
1026 | 1038 | ||
1027 | if (ar->fw == NULL) { | 1039 | if (ar->fw == NULL) { |
1040 | ath6kl_err("fw storage cannot be allocated, len: %zd\n", ie_len); | ||
1028 | ret = -ENOMEM; | 1041 | ret = -ENOMEM; |
1029 | goto out; | 1042 | goto out; |
1030 | } | 1043 | } |
@@ -1039,6 +1052,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name) | |||
1039 | ar->fw_patch = kmemdup(data, ie_len, GFP_KERNEL); | 1052 | ar->fw_patch = kmemdup(data, ie_len, GFP_KERNEL); |
1040 | 1053 | ||
1041 | if (ar->fw_patch == NULL) { | 1054 | if (ar->fw_patch == NULL) { |
1055 | ath6kl_err("fw_patch storage cannot be allocated, len: %zd\n", ie_len); | ||
1042 | ret = -ENOMEM; | 1056 | ret = -ENOMEM; |
1043 | goto out; | 1057 | goto out; |
1044 | } | 1058 | } |