Commit b9f5dba2 authored by Linus Torvalds's avatar Linus Torvalds

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
parents e1e22b27 053f78d3
...@@ -348,8 +348,7 @@ static int palmas_usb_probe(struct platform_device *pdev) ...@@ -348,8 +348,7 @@ static int palmas_usb_probe(struct platform_device *pdev)
palmas_vbus_irq_handler, palmas_vbus_irq_handler,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_FALLING |
IRQF_TRIGGER_RISING | IRQF_TRIGGER_RISING |
IRQF_ONESHOT | IRQF_ONESHOT,
IRQF_EARLY_RESUME,
"palmas_usb_vbus", "palmas_usb_vbus",
palmas_usb); palmas_usb);
if (status < 0) { if (status < 0) {
......
...@@ -458,8 +458,10 @@ static void lkdtm_do_action(enum ctype which) ...@@ -458,8 +458,10 @@ static void lkdtm_do_action(enum ctype which)
break; break;
val = kmalloc(len, GFP_KERNEL); val = kmalloc(len, GFP_KERNEL);
if (!val) if (!val) {
kfree(base);
break; break;
}
*val = 0x12345678; *val = 0x12345678;
base[offset] = *val; base[offset] = *val;
...@@ -498,14 +500,17 @@ static void lkdtm_do_action(enum ctype which) ...@@ -498,14 +500,17 @@ static void lkdtm_do_action(enum ctype which)
} }
case CT_READ_BUDDY_AFTER_FREE: { case CT_READ_BUDDY_AFTER_FREE: {
unsigned long p = __get_free_page(GFP_KERNEL); unsigned long p = __get_free_page(GFP_KERNEL);
int saw, *val = kmalloc(1024, GFP_KERNEL); int saw, *val;
int *base; int *base;
if (!p) if (!p)
break; break;
if (!val) val = kmalloc(1024, GFP_KERNEL);
if (!val) {
free_page(p);
break; break;
}
base = (int *)p; base = (int *)p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment