diff options
author | Jia-Ju Bai <baijiaju1990@163.com> | 2016-03-18 13:24:06 +1100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-04-07 19:37:43 +0300 |
commit | fe9b47944edff9b6244c4f5e81bd7b50574dc22b (patch) | |
tree | 104dd6724c69aa7eac544a6b0e92416a16211969 /arch/mips/kernel/segment.c | |
parent | fb9693f04544068e6176051ce5b96e4574730107 (diff) |
iwl4965: Fix a null pointer dereference in il_tx_queue_free and il_cmd_queue_free
If "txq->cmd = kzalloc(...)" in il_tx_queue_init fails,
"kfree(txq->cmd[i])" in il_tx_queue_free and il_cmd_queue_free
in iwl4965_hw_txq_ctx_free will causes a null pointer dereference,
because txq->cmd is NULL at that time.
This patch fixes this problem by adding a if-check before kfree.
To avoid double free in il_tx_queue_free and il_cmd_queue_free
caused by the fixing, txq->meta and txq->cmd in error handling code
of il_tx_queue_init are assigned null values.
Otherwise, a double free will occur.
This patch has been tested in real device, and it actually fixes the bug.
Thanks Stanislaw for his suggestion.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'arch/mips/kernel/segment.c')
0 files changed, 0 insertions, 0 deletions