bluetooth:Fix error handling in the function aes_cmac
Subsystems (2)
PATCH RESEND 1/1 bluetooth:Fix error handling in the function aes_cmac
This fixes error handling in the function aes_cmac by properly checking if the call to the function crypto_hast_init failed by returning a error code and if so tell the user with BT_ERR that the crypto hash table initialization failed before returning the error code to signal to the caller of this particular function that their call of aes_cmac has failed.
Signed-off-by Nicholas Krause <[email protected]>
--- net/bluetooth/smp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/bluetooth/smp.c +5 -1
@@ -184,7 +184,11 @@ static int aes_cmac(struct crypto_hash *tfm, const u8 k[16], const u8 *m, desc.tfm = tfm; desc.flags =0 ; -crypto_hash_init (&desc); + err =crypto_hash_init (&desc); +if (err) { +BT_ERR ("crypto hash init failed: %d" , err); +return err; + }/* Swap key and message from LSB to MSB */ swap_buf (k, tmp,16 );
Signature · 1 line
2.1.4