diff mbox series

crypto: ccree - fix missing break in switch statement

Message ID 20190211183131.GA19193@embeddedor (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series crypto: ccree - fix missing break in switch statement | expand

Commit Message

Gustavo A. R. Silva Feb. 11, 2019, 6:31 p.m. UTC
Add missing break statement in order to prevent the code from falling
through to case S_DIN_to_DES.

This bug was found thanks to the ongoing efforts to enable
-Wimplicit-fallthrough.

Fixes: 63ee04c8b491 ("crypto: ccree - add skcipher support")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/crypto/ccree/cc_cipher.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gustavo A. R. Silva Feb. 20, 2019, 6:09 p.m. UTC | #1
Hi all,

Friendly ping:

Who can take this?

Thanks
--
Gustavo

On 2/11/19 12:31 PM, Gustavo A. R. Silva wrote:
> Add missing break statement in order to prevent the code from falling
> through to case S_DIN_to_DES.
> 
> This bug was found thanks to the ongoing efforts to enable
> -Wimplicit-fallthrough.
> 
> Fixes: 63ee04c8b491 ("crypto: ccree - add skcipher support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  drivers/crypto/ccree/cc_cipher.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree/cc_cipher.c
> index 5e3361a363b5..d9c17078517b 100644
> --- a/drivers/crypto/ccree/cc_cipher.c
> +++ b/drivers/crypto/ccree/cc_cipher.c
> @@ -80,6 +80,7 @@ static int validate_keys_sizes(struct cc_cipher_ctx *ctx_p, u32 size)
>  		default:
>  			break;
>  		}
> +		break;
>  	case S_DIN_to_DES:
>  		if (size == DES3_EDE_KEY_SIZE || size == DES_KEY_SIZE)
>  			return 0;
>
Herbert Xu Feb. 22, 2019, 11:58 a.m. UTC | #2
On Mon, Feb 11, 2019 at 12:31:31PM -0600, Gustavo A. R. Silva wrote:
> Add missing break statement in order to prevent the code from falling
> through to case S_DIN_to_DES.
> 
> This bug was found thanks to the ongoing efforts to enable
> -Wimplicit-fallthrough.
> 
> Fixes: 63ee04c8b491 ("crypto: ccree - add skcipher support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  drivers/crypto/ccree/cc_cipher.c | 1 +
>  1 file changed, 1 insertion(+)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree/cc_cipher.c
index 5e3361a363b5..d9c17078517b 100644
--- a/drivers/crypto/ccree/cc_cipher.c
+++ b/drivers/crypto/ccree/cc_cipher.c
@@ -80,6 +80,7 @@  static int validate_keys_sizes(struct cc_cipher_ctx *ctx_p, u32 size)
 		default:
 			break;
 		}
+		break;
 	case S_DIN_to_DES:
 		if (size == DES3_EDE_KEY_SIZE || size == DES_KEY_SIZE)
 			return 0;