From: Kalle Valo <kvalo@codeaurora.org>
To: Luca Coelho <luca@coelho.fi>
Cc: linux-wireless@vger.kernel.org,
Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
Luca Coelho <luciano.coelho@intel.com>
Subject: Re: [PATCH 1/3] iwlwifi: mvm: Fix a memory leak in an error handling path in 'iwl_mvm_sar_get_wgds_table()'
Date: Mon, 07 Aug 2017 15:57:05 +0300 [thread overview]
Message-ID: <87d187len2.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20170805184743.23650-2-luca@coelho.fi> (Luca Coelho's message of "Sat, 5 Aug 2017 21:47:41 +0300")
Luca Coelho <luca@coelho.fi> writes:
> From: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
>
> We should free 'wgds.pointer' here as done a few lines above in another
> error handling path.
> It was allocated within 'acpi_evaluate_object()'.
>
> Fixes: c52030a01ccc ("iwlwifi: mvm: add GEO_TX_POWER_LIMIT cmd for geographic tx power table")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
> drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
> index 79e7a7a285dc..82863e9273eb 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
> @@ -1275,8 +1275,10 @@ static int iwl_mvm_sar_get_wgds_table(struct iwl_mvm *mvm)
>
> entry = &wifi_pkg->package.elements[idx++];
> if ((entry->type != ACPI_TYPE_INTEGER) ||
> - (entry->integer.value > U8_MAX))
> - return -EINVAL;
> + (entry->integer.value > U8_MAX)) {
> + ret = -EINVAL;
> + goto out_free;
> + }
How likely is this leak to happen in real world? To me it looks like
more like a theoretical issue and could have easily waited for 4.14. But
it's fine this time, just something to keep in mind in the future.
--
Kalle Valo
next prev parent reply other threads:[~2017-08-07 12:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-05 18:47 [PATCH 0/3] iwlwifi: fixes intended for 4.13 2017-08-05 Luca Coelho
2017-08-05 18:47 ` [PATCH 1/3] iwlwifi: mvm: Fix a memory leak in an error handling path in 'iwl_mvm_sar_get_wgds_table()' Luca Coelho
2017-08-07 12:57 ` Kalle Valo [this message]
2017-08-07 13:11 ` Luca Coelho
2017-08-07 13:37 ` Kalle Valo
2017-08-07 13:47 ` Luca Coelho
2017-08-05 18:47 ` [PATCH 2/3] iwlwifi: mvm: start mac queues when deferred tx frames are purged Luca Coelho
2017-08-07 12:58 ` Kalle Valo
2017-08-05 18:47 ` [PATCH 3/3] iwlwifi: mvm: don't WARN when a legit race happens in A-MPDU Luca Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d187len2.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=linux-wireless@vger.kernel.org \
--cc=luca@coelho.fi \
--cc=luciano.coelho@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.