Commit b9f5dba2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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) {
+8 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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;