All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mkfs.f2fs: Missing error check statement while allocating memory to write the super block.
@ 2018-07-26 22:01 Sotirios-Efstathios Maneas
  2018-07-28  0:54 ` Chao Yu
  2018-07-29  1:17 ` Jaegeuk Kim
  0 siblings, 2 replies; 3+ messages in thread
From: Sotirios-Efstathios Maneas @ 2018-07-26 22:01 UTC (permalink / raw)
  To: linux-f2fs-devel

Added a missing error check statement while allocating memory to write the super block.

---
 mkfs/f2fs_format.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index 1a2deae..491a9da 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -975,6 +975,10 @@ static int f2fs_write_super_block(void)
 	u_int8_t *zero_buff;
 
 	zero_buff = calloc(F2FS_BLKSIZE, 1);
+	if (!zero_buff) {
+		MSG(1, "\tError: Calloc Failed for f2fs_write_super_block!!!\n");
+		return -1;
+	}
 
 	memcpy(zero_buff + F2FS_SUPER_OFFSET, sb, sizeof(*sb));
 	DBG(1, "\tWriting super block, at offset 0x%08x\n", 0);
-- 
2.7.4

Kind regards,
Stathis Maneas


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: [PATCH 1/3] mkfs.f2fs: Missing error check statement while allocating memory to write the super block.
  2018-07-26 22:01 [PATCH 1/3] mkfs.f2fs: Missing error check statement while allocating memory to write the super block Sotirios-Efstathios Maneas
@ 2018-07-28  0:54 ` Chao Yu
  2018-07-29  1:17 ` Jaegeuk Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2018-07-28  0:54 UTC (permalink / raw)
  To: Sotirios-Efstathios Maneas, linux-f2fs-devel

On 2018/7/27 6:01, Sotirios-Efstathios Maneas wrote:
> Added a missing error check statement while allocating memory to write the super block.
> 

Missed a Signed-off-by in all your patch?

Thanks,

> ---
>  mkfs/f2fs_format.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index 1a2deae..491a9da 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -975,6 +975,10 @@ static int f2fs_write_super_block(void)
>  	u_int8_t *zero_buff;
>  
>  	zero_buff = calloc(F2FS_BLKSIZE, 1);
> +	if (!zero_buff) {
> +		MSG(1, "\tError: Calloc Failed for f2fs_write_super_block!!!\n");
> +		return -1;
> +	}
>  
>  	memcpy(zero_buff + F2FS_SUPER_OFFSET, sb, sizeof(*sb));
>  	DBG(1, "\tWriting super block, at offset 0x%08x\n", 0);
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: [PATCH 1/3] mkfs.f2fs: Missing error check statement while allocating memory to write the super block.
  2018-07-26 22:01 [PATCH 1/3] mkfs.f2fs: Missing error check statement while allocating memory to write the super block Sotirios-Efstathios Maneas
  2018-07-28  0:54 ` Chao Yu
@ 2018-07-29  1:17 ` Jaegeuk Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2018-07-29  1:17 UTC (permalink / raw)
  To: Sotirios-Efstathios Maneas; +Cc: linux-f2fs-devel

On 07/26, Sotirios-Efstathios Maneas wrote:
> Added a missing error check statement while allocating memory to write the super block.
> 
> ---
>  mkfs/f2fs_format.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index 1a2deae..491a9da 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -975,6 +975,10 @@ static int f2fs_write_super_block(void)
>  	u_int8_t *zero_buff;
>  
>  	zero_buff = calloc(F2FS_BLKSIZE, 1);
> +	if (!zero_buff) {
> +		MSG(1, "\tError: Calloc Failed for f2fs_write_super_block!!!\n");
                                        ------
                                        failed to follow your typo patch?

> +		return -1;
> +	}
>  
>  	memcpy(zero_buff + F2FS_SUPER_OFFSET, sb, sizeof(*sb));
>  	DBG(1, "\tWriting super block, at offset 0x%08x\n", 0);
> -- 
> 2.7.4
> 
> Kind regards,
> Stathis Maneas
> 
> 
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

end of thread, other threads:[~2018-07-29  1:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26 22:01 [PATCH 1/3] mkfs.f2fs: Missing error check statement while allocating memory to write the super block Sotirios-Efstathios Maneas
2018-07-28  0:54 ` Chao Yu
2018-07-29  1:17 ` Jaegeuk Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.