Re: [PATCH 17/74] debugfs: don't leak mmp_s memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 10, 2013, at 6:20 PM, Darrick J. Wong <darrick.wong@xxxxxxxxxx> wrote:
> ext2fs_free_mem() takes a pointer to a pointer, similar to
> ext2fs_get_mem().  Improve the documentation, and fix debugfs.
> 
> diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
> index 64e498f..0624350 100644
> --- a/lib/ext2fs/ext2fs.h
> +++ b/lib/ext2fs/ext2fs.h
> @@ -1608,7 +1608,7 @@ _INLINE_ void ext2fs_init_csum_seed(ext2_filsys fs)
> #ifndef EXT2_CUSTOM_MEMORY_ROUTINES
> #include <string.h>
> /*
> - *  Allocate memory
> + *  Allocate memory.  The 'ptr' arg must point to a pointer.
>  */
> _INLINE_ errcode_t ext2fs_get_mem(unsigned long size, void *ptr)
> {

Would that imply the second argument in all of these functions is "void **ptr"?
Does GCC handle that correctly?  Do other compilers?  Am I just clueless?

Cheers, Andreas

> @@ -1655,7 +1655,7 @@ _INLINE_ errcode_t ext2fs_get_arrayzero(unsigned long count,
> }
> 
> /*
> - * Free memory
> + * Free memory.  The 'ptr' arg must point to a pointer.
>  */
> _INLINE_ errcode_t ext2fs_free_mem(void *ptr)
> {
> @@ -1669,7 +1669,7 @@ _INLINE_ errcode_t ext2fs_free_mem(void *ptr)
> }
> 
> /*
> - *  Resize memory
> + *  Resize memory.  The 'ptr' arg must point to a pointer.
>  */
> _INLINE_ errcode_t ext2fs_resize_mem(unsigned long EXT2FS_ATTR((unused)) old_size,
> 				     unsigned long size, void *ptr)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Cheers, Andreas





Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux