diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-16 23:59:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-16 23:59:06 -0400 |
commit | b9f5dba225aede4518ab0a7374c2dc38c7c049ce (patch) | |
tree | 1b8e544d044b80958bd10f5b58029eed5ec8d176 | |
parent | e1e22b27ec6c83d026c2ca14624f207a08c28ec3 (diff) | |
parent | 053f78d359953be40043972c98e16b3f1cd9fc27 (diff) |
Merge tag 'char-misc-4.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc fixes from Greg KH:
"Here are some small char/misc driver fixes for 4.6-rc4. Full details
are in the shortlog, nothing major here.
These have all been in linux-next for a while with no reported issues"
* tag 'char-misc-4.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
lkdtm: do not leak free page on kmalloc failure
lkdtm: fix memory leak of base
lkdtm: fix memory leak of val
extcon: palmas: Drop stray IRQF_EARLY_RESUME flag
-rw-r--r-- | drivers/extcon/extcon-palmas.c | 3 | ||||
-rw-r--r-- | drivers/misc/lkdtm.c | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c index 841a4b586395..8b3226dca1d9 100644 --- a/drivers/extcon/extcon-palmas.c +++ b/drivers/extcon/extcon-palmas.c | |||
@@ -348,8 +348,7 @@ static int palmas_usb_probe(struct platform_device *pdev) | |||
348 | palmas_vbus_irq_handler, | 348 | palmas_vbus_irq_handler, |
349 | IRQF_TRIGGER_FALLING | | 349 | IRQF_TRIGGER_FALLING | |
350 | IRQF_TRIGGER_RISING | | 350 | IRQF_TRIGGER_RISING | |
351 | IRQF_ONESHOT | | 351 | IRQF_ONESHOT, |
352 | IRQF_EARLY_RESUME, | ||
353 | "palmas_usb_vbus", | 352 | "palmas_usb_vbus", |
354 | palmas_usb); | 353 | palmas_usb); |
355 | if (status < 0) { | 354 | if (status < 0) { |
diff --git a/drivers/misc/lkdtm.c b/drivers/misc/lkdtm.c index 5f1a36b8fbb0..0a5cbbe12452 100644 --- a/drivers/misc/lkdtm.c +++ b/drivers/misc/lkdtm.c | |||
@@ -458,8 +458,10 @@ static void lkdtm_do_action(enum ctype which) | |||
458 | break; | 458 | break; |
459 | 459 | ||
460 | val = kmalloc(len, GFP_KERNEL); | 460 | val = kmalloc(len, GFP_KERNEL); |
461 | if (!val) | 461 | if (!val) { |
462 | kfree(base); | ||
462 | break; | 463 | break; |
464 | } | ||
463 | 465 | ||
464 | *val = 0x12345678; | 466 | *val = 0x12345678; |
465 | base[offset] = *val; | 467 | base[offset] = *val; |
@@ -498,14 +500,17 @@ static void lkdtm_do_action(enum ctype which) | |||
498 | } | 500 | } |
499 | case CT_READ_BUDDY_AFTER_FREE: { | 501 | case CT_READ_BUDDY_AFTER_FREE: { |
500 | unsigned long p = __get_free_page(GFP_KERNEL); | 502 | unsigned long p = __get_free_page(GFP_KERNEL); |
501 | int saw, *val = kmalloc(1024, GFP_KERNEL); | 503 | int saw, *val; |
502 | int *base; | 504 | int *base; |
503 | 505 | ||
504 | if (!p) | 506 | if (!p) |
505 | break; | 507 | break; |
506 | 508 | ||
507 | if (!val) | 509 | val = kmalloc(1024, GFP_KERNEL); |
510 | if (!val) { | ||
511 | free_page(p); | ||
508 | break; | 512 | break; |
513 | } | ||
509 | 514 | ||
510 | base = (int *)p; | 515 | base = (int *)p; |
511 | 516 | ||