kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/ntfs3: Delete dead code in ni_write_frame()
@ 2021-08-27 10:05 Dan Carpenter
  2021-08-27 10:14 ` Kari Argillander
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-08-27 10:05 UTC (permalink / raw)
  To: Konstantin Komarov; +Cc: ntfs3, kernel-janitors

This code sets "lznt" to NULL and then kfrees it.  Kfreeing a NULL is a
no-op so delete the code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/ntfs3/frecord.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index c3121bf9c62f..c1a9f124f771 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -2742,7 +2742,6 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages,
 	}
 
 	mutex_lock(&sbi->compress.mtx_lznt);
-	lznt = NULL;
 	if (!sbi->compress.lznt) {
 		/*
 		 * lznt implements two levels of compression:
@@ -2758,14 +2757,12 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages,
 		}
 
 		sbi->compress.lznt = lznt;
-		lznt = NULL;
 	}
 
 	/* compress: frame_mem -> frame_ondisk */
 	compr_size = compress_lznt(frame_mem, frame_size, frame_ondisk,
 				   frame_size, sbi->compress.lznt);
 	mutex_unlock(&sbi->compress.mtx_lznt);
-	ntfs_free(lznt);
 
 	if (compr_size + sbi->cluster_size > frame_size) {
 		/* frame is not compressed */
-- 
2.20.1


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

* Re: [PATCH] fs/ntfs3: Delete dead code in ni_write_frame()
  2021-08-27 10:05 [PATCH] fs/ntfs3: Delete dead code in ni_write_frame() Dan Carpenter
@ 2021-08-27 10:14 ` Kari Argillander
  0 siblings, 0 replies; 2+ messages in thread
From: Kari Argillander @ 2021-08-27 10:14 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Konstantin Komarov, ntfs3, kernel-janitors

On Fri, Aug 27, 2021 at 01:05:29PM +0300, Dan Carpenter wrote:
> This code sets "lznt" to NULL and then kfrees it.  Kfreeing a NULL is a
> no-op so delete the code.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Kari Argillander <kari.argillander@gmail.com>

> ---
>  fs/ntfs3/frecord.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
> index c3121bf9c62f..c1a9f124f771 100644
> --- a/fs/ntfs3/frecord.c
> +++ b/fs/ntfs3/frecord.c
> @@ -2742,7 +2742,6 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages,
>  	}
>  
>  	mutex_lock(&sbi->compress.mtx_lznt);
> -	lznt = NULL;
>  	if (!sbi->compress.lznt) {
>  		/*
>  		 * lznt implements two levels of compression:
> @@ -2758,14 +2757,12 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages,
>  		}
>  
>  		sbi->compress.lznt = lznt;
> -		lznt = NULL;
>  	}
>  
>  	/* compress: frame_mem -> frame_ondisk */
>  	compr_size = compress_lznt(frame_mem, frame_size, frame_ondisk,
>  				   frame_size, sbi->compress.lznt);
>  	mutex_unlock(&sbi->compress.mtx_lznt);
> -	ntfs_free(lznt);
>  
>  	if (compr_size + sbi->cluster_size > frame_size) {
>  		/* frame is not compressed */
> -- 
> 2.20.1
> 
> 

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

end of thread, other threads:[~2021-08-27 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 10:05 [PATCH] fs/ntfs3: Delete dead code in ni_write_frame() Dan Carpenter
2021-08-27 10:14 ` Kari Argillander

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 NNTP newsgroup(s).