* [PATCH 1/2] ath10k: fix printf format string
2013-10-04 6:13 [PATCH 0/2] ath10k: minor fixes Michal Kazior
@ 2013-10-04 6:13 ` Michal Kazior
2013-10-04 6:13 ` [PATCH 2/2] ath10k: fix possible memory leak in new FW loading Michal Kazior
2013-10-08 12:23 ` [PATCH 0/2] ath10k: minor fixes Kalle Valo
2 siblings, 0 replies; 4+ messages in thread
From: Michal Kazior @ 2013-10-04 6:13 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
size_t corresponds to %zu not %d. Compiler was
complaining about it.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 7b5dd09..bf85d34 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -402,7 +402,7 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name)
magic_len = strlen(ATH10K_FIRMWARE_MAGIC) + 1;
if (len < magic_len) {
- ath10k_err("firmware image too small to contain magic: %d\n",
+ ath10k_err("firmware image too small to contain magic: %zu\n",
len);
return -EINVAL;
}
@@ -429,7 +429,7 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name)
data += sizeof(*hdr);
if (len < ie_len) {
- ath10k_err("Invalid length for FW IE %d (%d < %d)\n",
+ ath10k_err("Invalid length for FW IE %d (%zu < %zu)\n",
ie_id, len, ie_len);
return -EINVAL;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] ath10k: fix possible memory leak in new FW loading
2013-10-04 6:13 [PATCH 0/2] ath10k: minor fixes Michal Kazior
2013-10-04 6:13 ` [PATCH 1/2] ath10k: fix printf format string Michal Kazior
@ 2013-10-04 6:13 ` Michal Kazior
2013-10-08 12:23 ` [PATCH 0/2] ath10k: minor fixes Kalle Valo
2 siblings, 0 replies; 4+ messages in thread
From: Michal Kazior @ 2013-10-04 6:13 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
Some failpaths did `return` instead of a `goto`
leaking requested firmware.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index bf85d34..5acb404 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -404,12 +404,14 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name)
if (len < magic_len) {
ath10k_err("firmware image too small to contain magic: %zu\n",
len);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err;
}
if (memcmp(data, ATH10K_FIRMWARE_MAGIC, magic_len) != 0) {
ath10k_err("Invalid firmware magic\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto err;
}
/* jump over the padding */
@@ -431,7 +433,8 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name)
if (len < ie_len) {
ath10k_err("Invalid length for FW IE %d (%zu < %zu)\n",
ie_id, len, ie_len);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err;
}
switch (ie_id) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 0/2] ath10k: minor fixes
2013-10-04 6:13 [PATCH 0/2] ath10k: minor fixes Michal Kazior
2013-10-04 6:13 ` [PATCH 1/2] ath10k: fix printf format string Michal Kazior
2013-10-04 6:13 ` [PATCH 2/2] ath10k: fix possible memory leak in new FW loading Michal Kazior
@ 2013-10-08 12:23 ` Kalle Valo
2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2013-10-08 12:23 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
Michal Kazior <michal.kazior@tieto.com> writes:
> The patchset fixes a compilation warning and a
> memory leak in FW loading code.
>
> Michal Kazior (2):
> ath10k: fix printf format string
> ath10k: fix possible memory leak in new FW loading
Both appplied, thanks for fixing my bugs :)
--
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread