lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1172439662.13541.2.camel@localhost.localdomain>
Date:	Mon, 26 Feb 2007 08:41:02 +1100
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Pekka J Enberg <penberg@...helsinki.fi>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] module: use krealloc

On Fri, 2007-02-23 at 09:41 +0200, Pekka J Enberg wrote:
> From: Pekka Enberg <penberg@...helsinki.fi>
> 
> This converts an open-coded krealloc() to use the shiny new API.

OK, why not.

Thanks!
Rusty.

From: Pekka Enberg <penberg@...helsinki.fi>

This converts an open-coded krealloc() to use the shiny new API.

Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
---
 kernel/module.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: uml-2.6/kernel/module.c
===================================================================
--- uml-2.6.orig/kernel/module.c	2007-02-23 09:24:14.000000000 +0200
+++ uml-2.6/kernel/module.c	2007-02-23 09:34:43.000000000 +0200
@@ -308,14 +308,14 @@
 {
 	/* Reallocation required? */
 	if (pcpu_num_used + 1 > pcpu_num_allocated) {
-		int *new = kmalloc(sizeof(new[0]) * pcpu_num_allocated*2,
-				   GFP_KERNEL);
+		int *new;
+
+		new = krealloc(pcpu_size, sizeof(new[0])*pcpu_num_allocated*2,
+			       GFP_KERNEL);
 		if (!new)
 			return 0;
 
-		memcpy(new, pcpu_size, sizeof(new[0])*pcpu_num_allocated);
 		pcpu_num_allocated *= 2;
-		kfree(pcpu_size);
 		pcpu_size = new;
 	}
 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ