aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMariusz Kozlowski <mk@lab.zgora.pl>2010-11-22 14:37:21 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-22 14:37:21 -0500
commitba5787323d38084b30261e84510d4a173fcb493a (patch)
tree8d3c718f5627ac5898bcd56a993e6aca944dabfc
parentdd8717da6da9b0e745df49762be4573010f1013c (diff)
ide: fix use after free in ide-acpi
out_obj points to kfreed memory and we dereference that pointer in DEBPRINT/printk. Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/ide/ide-acpi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index c26c11905ffe..2af8cb460a3b 100644
--- a/drivers/ide/ide-acpi.c
+++ b/drivers/ide/ide-acpi.c
@@ -416,21 +416,21 @@ void ide_acpi_get_timing(ide_hwif_t *hwif)
416 416
417 out_obj = output.pointer; 417 out_obj = output.pointer;
418 if (out_obj->type != ACPI_TYPE_BUFFER) { 418 if (out_obj->type != ACPI_TYPE_BUFFER) {
419 kfree(output.pointer);
420 DEBPRINT("Run _GTM: error: " 419 DEBPRINT("Run _GTM: error: "
421 "expected object type of ACPI_TYPE_BUFFER, " 420 "expected object type of ACPI_TYPE_BUFFER, "
422 "got 0x%x\n", out_obj->type); 421 "got 0x%x\n", out_obj->type);
422 kfree(output.pointer);
423 return; 423 return;
424 } 424 }
425 425
426 if (!out_obj->buffer.length || !out_obj->buffer.pointer || 426 if (!out_obj->buffer.length || !out_obj->buffer.pointer ||
427 out_obj->buffer.length != sizeof(struct GTM_buffer)) { 427 out_obj->buffer.length != sizeof(struct GTM_buffer)) {
428 kfree(output.pointer);
429 printk(KERN_ERR 428 printk(KERN_ERR
430 "%s: unexpected _GTM length (0x%x)[should be 0x%zx] or " 429 "%s: unexpected _GTM length (0x%x)[should be 0x%zx] or "
431 "addr (0x%p)\n", 430 "addr (0x%p)\n",
432 __func__, out_obj->buffer.length, 431 __func__, out_obj->buffer.length,
433 sizeof(struct GTM_buffer), out_obj->buffer.pointer); 432 sizeof(struct GTM_buffer), out_obj->buffer.pointer);
433 kfree(output.pointer);
434 return; 434 return;
435 } 435 }
436 436