Commit e2af2451 authored by Colin Ian King's avatar Colin Ian King Committed by Ben Hutchings
Browse files

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



commit 98e26302 upstream.

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>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent e2cb920d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment