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

Commit 475dae38 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Torvalds
Browse files

kernel/sysctl.c: switch to bitmap_zalloc()

Switch to bitmap_zalloc() to show clearly what we are allocating.
Besides that it returns pointer of bitmap type instead of opaque void *.

Link: http://lkml.kernel.org/r/20190304094037.57756-1-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 23015b22
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -3178,9 +3178,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
		if (IS_ERR(kbuf))
			return PTR_ERR(kbuf);

		tmp_bitmap = kcalloc(BITS_TO_LONGS(bitmap_len),
				     sizeof(unsigned long),
				     GFP_KERNEL);
		tmp_bitmap = bitmap_zalloc(bitmap_len, GFP_KERNEL);
		if (!tmp_bitmap) {
			kfree(kbuf);
			return -ENOMEM;
@@ -3271,7 +3269,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
		*ppos += *lenp;
	}

	kfree(tmp_bitmap);
	bitmap_free(tmp_bitmap);
	return err;
}