public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW_DM libdm/mm/dbg_malloc.c
@ 2011-10-20 13:33 zkabelac
  0 siblings, 0 replies; 2+ messages in thread
From: zkabelac @ 2011-10-20 13:33 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-20 13:33:41

Modified files:
	.              : WHATS_NEW_DM 
	libdm/mm       : dbg_malloc.c 

Log message:
	Simplify some pointer operations

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.513&r2=1.514
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/dbg_malloc.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24

--- LVM2/WHATS_NEW_DM	2011/10/20 13:23:52	1.513
+++ LVM2/WHATS_NEW_DM	2011/10/20 13:33:41	1.514
@@ -1,5 +1,6 @@
 Version 1.02.68 -
 ==================================
+  Simplify some pointer operations in dm_free_aux() debug code..
   Remove unused dbg_malloc.h file from source tree.
   Cleanup backtraces for _create_and_load_v4().
   Fix alignment warning in bitcount calculation for raid segment.
--- LVM2/libdm/mm/dbg_malloc.c	2011/02/08 15:52:00	1.23
+++ LVM2/libdm/mm/dbg_malloc.c	2011/10/20 13:33:41	1.24
@@ -143,9 +143,9 @@
 	assert(mb->magic == p);
 
 	/* check data at the far boundary */
-	ptr = ((char *) mb) + sizeof(struct memblock) + mb->length;
+	ptr = (char *) p + mb->length;
 	for (i = 0; i < sizeof(unsigned long); i++)
-		if (*ptr++ != (char) mb->id)
+		if (ptr[i] != (char) mb->id)
 			assert(!"Damage at far end of block");
 
 	/* have we freed this before ? */
@@ -165,9 +165,9 @@
 	mb->id = 0;
 
 	/* stomp a different pattern across the memory */
-	ptr = ((char *) mb) + sizeof(struct memblock);
+	ptr = p;
 	for (i = 0; i < mb->length; i++)
-		*ptr++ = i & 1 ? (char) 0xde : (char) 0xad;
+		ptr[i] = i & 1 ? (char) 0xde : (char) 0xad;
 
 	assert(_mem_stats.blocks_allocated);
 	_mem_stats.blocks_allocated--;


^ permalink raw reply	[flat|nested] 2+ messages in thread
* LVM2 ./WHATS_NEW_DM libdm/mm/dbg_malloc.c
@ 2012-02-10 13:52 zkabelac
  0 siblings, 0 replies; 2+ messages in thread
From: zkabelac @ 2012-02-10 13:52 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-10 13:52:06

Modified files:
	.              : WHATS_NEW_DM 
	libdm/mm       : dbg_malloc.c 

Log message:
	Add test for failing allocation
	
	Avoid memcpy to NULL if realloc fails.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.543&r2=1.544
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/dbg_malloc.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26

--- LVM2/WHATS_NEW_DM	2012/02/10 13:49:29	1.543
+++ LVM2/WHATS_NEW_DM	2012/02/10 13:52:05	1.544
@@ -1,5 +1,6 @@
 Version 1.02.70 - 
 ===================================
+  Add missing test for failing allocation in dm_realloc() code.
   Add test for memory allocation failures in regex matcher code.
   Simplify dm_task_set_geometry() and use dm_asprintf().
   Set all parameters to 0 for dm_get_next_target() for NULL return.
--- LVM2/libdm/mm/dbg_malloc.c	2011/10/28 20:37:31	1.25
+++ LVM2/libdm/mm/dbg_malloc.c	2012/02/10 13:52:05	1.26
@@ -192,7 +192,7 @@
 
 	r = dm_malloc_aux_debug(s, file, line);
 
-	if (p) {
+	if (r && p) {
 		memcpy(r, p, mb->length);
 		dm_free_aux(p);
 	}


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-10 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-20 13:33 LVM2 ./WHATS_NEW_DM libdm/mm/dbg_malloc.c zkabelac
2012-02-10 13:52 zkabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).