Skip to content

Commit

Permalink
ecryptfs: ecryptfs_msg_ctx_alloc_to_free(): remove kfree() redundant …
Browse files Browse the repository at this point in the history
…null check

smatch analysis:

fs/ecryptfs/messaging.c:101 ecryptfs_msg_ctx_alloc_to_free() info:
 redundant null check on msg_ctx->msg calling kfree()

Cc: Dustin Kirkland <[email protected]>
Cc: [email protected]
Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Tyler Hicks <[email protected]>
  • Loading branch information
rtg-canonical authored and tyhicks committed Feb 12, 2013
1 parent 3a46741 commit 1101d58
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/ecryptfs/messaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ static void ecryptfs_msg_ctx_free_to_alloc(struct ecryptfs_msg_ctx *msg_ctx)
void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx)
{
list_move(&(msg_ctx->node), &ecryptfs_msg_ctx_free_list);
if (msg_ctx->msg)
kfree(msg_ctx->msg);
kfree(msg_ctx->msg);
msg_ctx->msg = NULL;
msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_FREE;
}
Expand Down

0 comments on commit 1101d58

Please sign in to comment.