Skip to content

Commit b9f5dba

Browse files
committed
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
2 parents e1e22b2 + 053f78d commit b9f5dba

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

drivers/extcon/extcon-palmas.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ static int palmas_usb_probe(struct platform_device *pdev)
348348
palmas_vbus_irq_handler,
349349
IRQF_TRIGGER_FALLING |
350350
IRQF_TRIGGER_RISING |
351-
IRQF_ONESHOT |
352-
IRQF_EARLY_RESUME,
351+
IRQF_ONESHOT,
353352
"palmas_usb_vbus",
354353
palmas_usb);
355354
if (status < 0) {

drivers/misc/lkdtm.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,10 @@ static void lkdtm_do_action(enum ctype which)
458458
break;
459459

460460
val = kmalloc(len, GFP_KERNEL);
461-
if (!val)
461+
if (!val) {
462+
kfree(base);
462463
break;
464+
}
463465

464466
*val = 0x12345678;
465467
base[offset] = *val;
@@ -498,14 +500,17 @@ static void lkdtm_do_action(enum ctype which)
498500
}
499501
case CT_READ_BUDDY_AFTER_FREE: {
500502
unsigned long p = __get_free_page(GFP_KERNEL);
501-
int saw, *val = kmalloc(1024, GFP_KERNEL);
503+
int saw, *val;
502504
int *base;
503505

504506
if (!p)
505507
break;
506508

507-
if (!val)
509+
val = kmalloc(1024, GFP_KERNEL);
510+
if (!val) {
511+
free_page(p);
508512
break;
513+
}
509514

510515
base = (int *)p;
511516

0 commit comments

Comments
 (0)