Skip to content

Commit

Permalink
Merge tag 'char-misc-4.6-rc4' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
Linus Torvalds committed Apr 17, 2016
2 parents e1e22b2 + 053f78d commit b9f5dba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions drivers/extcon/extcon-palmas.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ static int palmas_usb_probe(struct platform_device *pdev)
palmas_vbus_irq_handler,
IRQF_TRIGGER_FALLING |
IRQF_TRIGGER_RISING |
IRQF_ONESHOT |
IRQF_EARLY_RESUME,
IRQF_ONESHOT,
"palmas_usb_vbus",
palmas_usb);
if (status < 0) {
Expand Down
11 changes: 8 additions & 3 deletions drivers/misc/lkdtm.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,10 @@ static void lkdtm_do_action(enum ctype which)
break;

val = kmalloc(len, GFP_KERNEL);
if (!val)
if (!val) {
kfree(base);
break;
}

*val = 0x12345678;
base[offset] = *val;
Expand Down Expand Up @@ -498,14 +500,17 @@ static void lkdtm_do_action(enum ctype which)
}
case CT_READ_BUDDY_AFTER_FREE: {
unsigned long p = __get_free_page(GFP_KERNEL);
int saw, *val = kmalloc(1024, GFP_KERNEL);
int saw, *val;
int *base;

if (!p)
break;

if (!val)
val = kmalloc(1024, GFP_KERNEL);
if (!val) {
free_page(p);
break;
}

base = (int *)p;

Expand Down

0 comments on commit b9f5dba

Please sign in to comment.