Skip to content
Commit 0e7bf23e authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Kalle Valo
Browse files

ath6kl: Fix a possible null-pointer dereference in ath6kl_htc_mbox_create()



In ath6kl_htc_mbox_create(), when kzalloc() on line 2855 fails,
target->dev is assigned to NULL, and ath6kl_htc_mbox_cleanup(target) is
called on line 2885.

In ath6kl_htc_mbox_cleanup(), target->dev is used on line 2895:
    ath6kl_hif_cleanup_scatter(target->dev->ar);

Thus, a null-pointer dereference may occur.

To fix this bug, kfree(target) is called and NULL is returned when
kzalloc() on line 2855 fails.

This bug is found by a static analysis tool STCheck written by us.

Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 72bb1aa9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment