2020-09-21 11:35:14

by Pavel Machek

[permalink] [raw]
Subject: [PATCH] crypto: ccp - fix error handling

Fix resource leak in error handling.

Signed-off-by: Pavel Machek (CIP) <[email protected]>

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


Attachments:
(No filename) (644.00 B)
signature.asc (201.00 B)
Download all attachments

2020-09-22 13:00:35

by John Allen

[permalink] [raw]
Subject: Re: [PATCH] crypto: ccp - fix error handling

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) <[email protected]>

Acked-by: John Allen <[email protected]>

>
> 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


2020-09-22 13:41:40

by Tom Lendacky

[permalink] [raw]
Subject: Re: [PATCH] crypto: ccp - fix error handling

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) <[email protected]>
>
> 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 */
>

2020-10-02 11:55:03

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: ccp - fix error handling

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) <[email protected]>

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt