2014-06-16 18:07:35

by Fabian Frédérick

[permalink] [raw]
Subject: [PATCH 1/1] fs/ecryptfs/messaging.c: remove null test before kfree

Fix checkpatch warning:
WARNING: kfree(NULL) is safe this check is probably not required

Cc: Tyler Hicks <[email protected]>
Cc: [email protected]
Signed-off-by: Fabian Frederick <[email protected]>
---
fs/ecryptfs/messaging.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c
index e57380e..286f10b 100644
--- a/fs/ecryptfs/messaging.c
+++ b/fs/ecryptfs/messaging.c
@@ -434,8 +434,7 @@ void ecryptfs_release_messaging(void)
mutex_lock(&ecryptfs_msg_ctx_lists_mux);
for (i = 0; i < ecryptfs_message_buf_len; i++) {
mutex_lock(&ecryptfs_msg_ctx_arr[i].mux);
- if (ecryptfs_msg_ctx_arr[i].msg)
- kfree(ecryptfs_msg_ctx_arr[i].msg);
+ kfree(ecryptfs_msg_ctx_arr[i].msg);
mutex_unlock(&ecryptfs_msg_ctx_arr[i].mux);
}
kfree(ecryptfs_msg_ctx_arr);
--
1.8.4.5


2014-07-03 21:33:04

by Tyler Hicks

[permalink] [raw]
Subject: Re: [PATCH 1/1] fs/ecryptfs/messaging.c: remove null test before kfree

On 2014-06-16 20:06:12, Fabian Frederick wrote:
> Fix checkpatch warning:
> WARNING: kfree(NULL) is safe this check is probably not required
>
> Cc: Tyler Hicks <[email protected]>
> Cc: [email protected]
> Signed-off-by: Fabian Frederick <[email protected]>
> ---

Hi Fabian - Sorry for being slow to respond. This patch looks good. I'll
push it to my next branch.

Tyler

> fs/ecryptfs/messaging.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c
> index e57380e..286f10b 100644
> --- a/fs/ecryptfs/messaging.c
> +++ b/fs/ecryptfs/messaging.c
> @@ -434,8 +434,7 @@ void ecryptfs_release_messaging(void)
> mutex_lock(&ecryptfs_msg_ctx_lists_mux);
> for (i = 0; i < ecryptfs_message_buf_len; i++) {
> mutex_lock(&ecryptfs_msg_ctx_arr[i].mux);
> - if (ecryptfs_msg_ctx_arr[i].msg)
> - kfree(ecryptfs_msg_ctx_arr[i].msg);
> + kfree(ecryptfs_msg_ctx_arr[i].msg);
> mutex_unlock(&ecryptfs_msg_ctx_arr[i].mux);
> }
> kfree(ecryptfs_msg_ctx_arr);
> --
> 1.8.4.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe ecryptfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html


Attachments:
(No filename) (1.24 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments