Skip to content
Commit 98e26302 authored by Colin Ian King's avatar Colin Ian King Committed by Darren Hart (VMware)
Browse files

platform/x86: alienware-wmi: fix kfree on potentially uninitialized pointer



Currently the kfree of output.pointer can be potentially freeing
an uninitalized pointer in the case where out_data is NULL. Fix this
by reworking the case where out_data is not-null to perform the
ACPI status check and also the kfree of outpoint.pointer in one block
and hence ensuring the pointer is only freed when it has been used.

Also replace the if (ptr != NULL) idiom with just if (ptr).

Fixes: ff0e9f26 ("platform/x86: alienware-wmi: Correct a memory leak")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
parent 6cc13c28
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment