diff options
author | Dave Airlie <airlied@redhat.com> | 2012-02-02 15:25:16 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-09-12 03:37:20 +0100 |
commit | 4472ab2724f5d9caaa6d9135944a052cff916545 (patch) | |
tree | f3fd750b6aadbd1b974f94fc7a7c273317c6071e | |
parent | 122d1fd84d1d67a466877df35a9a9c6ca531ea2e (diff) |
drm/radeon: fix use after free in ATRM bios reading code.
commit de47a9cd62771e3e78954d855d2304fbad4c5a44 upstream.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=45503
Reported-and-Debugged-by: mlambda@gmail.com
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atpx_handler.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c index 13ac63ba607..98724fcb008 100644 --- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c +++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c @@ -59,8 +59,9 @@ static int radeon_atrm_call(acpi_handle atrm_handle, uint8_t *bios, obj = (union acpi_object *)buffer.pointer; memcpy(bios+offset, obj->buffer.pointer, obj->buffer.length); + len = obj->buffer.length; kfree(buffer.pointer); - return obj->buffer.length; + return len; } bool radeon_atrm_supported(struct pci_dev *pdev) |