Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1686cc1a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull livepatch update from Jiri Kosina:
 "Return value checking fixup in livepatching samples, from Nicholas Mc
  Guire"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching:
  livepatch: check kzalloc return values
parents 5c4a6083 5f30b2e8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -89,6 +89,11 @@ struct dummy *livepatch_fix1_dummy_alloc(void)
	 * pointer to handle resource release.
	 */
	leak = kzalloc(sizeof(int), GFP_KERNEL);
	if (!leak) {
		kfree(d);
		return NULL;
	}

	klp_shadow_alloc(d, SV_LEAK, sizeof(leak), GFP_KERNEL,
			 shadow_leak_ctor, leak);

+4 −0
Original line number Diff line number Diff line
@@ -118,6 +118,10 @@ noinline struct dummy *dummy_alloc(void)

	/* Oops, forgot to save leak! */
	leak = kzalloc(sizeof(int), GFP_KERNEL);
	if (!leak) {
		kfree(d);
		return NULL;
	}

	pr_info("%s: dummy @ %p, expires @ %lx\n",
		__func__, d, d->jiffies_expire);