diff mbox series

crypto: ccp - fix error handling

Message ID 20200921113435.GA20450@duo.ucw.cz
State Accepted
Commit e356c49c6cf0db3f00e1558749170bd56e47652d
Headers show
Series crypto: ccp - fix error handling | expand

Commit Message

Pavel Machek Sept. 21, 2020, 11:34 a.m. UTC
Fix resource leak in error handling.

Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>

Comments

John Allen Sept. 22, 2020, 12:59 p.m. UTC | #1
On Mon, Sep 21, 2020 at 01:34:35PM +0200, Pavel Machek wrote:
> Fix resource leak in error handling.

> 

> Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>


Acked-by: John Allen <john.allen@amd.com>


> 

> diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c

> index bd270e66185e..40869ea1ed20 100644

> --- a/drivers/crypto/ccp/ccp-ops.c

> +++ b/drivers/crypto/ccp/ccp-ops.c

> @@ -1744,7 +1744,7 @@ ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)

>  			break;

>  		default:

>  			ret = -EINVAL;

> -			goto e_ctx;

> +			goto e_data;

>  		}

>  	} else {

>  		/* Stash the context */

> 

> -- 

> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk

> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Tom Lendacky Sept. 22, 2020, 1:41 p.m. UTC | #2
On 9/21/20 6:34 AM, Pavel Machek wrote:
> Fix resource leak in error handling.


Does it need a Fixes: tag?

Thanks,
Tom

> 

> Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>

> 

> diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c

> index bd270e66185e..40869ea1ed20 100644

> --- a/drivers/crypto/ccp/ccp-ops.c

> +++ b/drivers/crypto/ccp/ccp-ops.c

> @@ -1744,7 +1744,7 @@ ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)

>  			break;

>  		default:

>  			ret = -EINVAL;

> -			goto e_ctx;

> +			goto e_data;

>  		}

>  	} else {

>  		/* Stash the context */

>
Herbert Xu Oct. 2, 2020, 11:54 a.m. UTC | #3
On Mon, Sep 21, 2020 at 01:34:35PM +0200, Pavel Machek wrote:
> Fix resource leak in error handling.
> 
> Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
index bd270e66185e..40869ea1ed20 100644
--- a/drivers/crypto/ccp/ccp-ops.c
+++ b/drivers/crypto/ccp/ccp-ops.c
@@ -1744,7 +1744,7 @@  ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
 			break;
 		default:
 			ret = -EINVAL;
-			goto e_ctx;
+			goto e_data;
 		}
 	} else {
 		/* Stash the context */