Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: atmel-sha204a - Fix uninitialized data access on OTP read error

Return early if atmel_i2c_send_receive() fails to avoid checking
potentially uninitialized data in 'cmd.data'.

Cc: stable@vger.kernel.org
Fixes: e05ce444e9e5 ("crypto: atmel-sha204a - add reading from otp zone")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thorsten Blum and committed by
Herbert Xu
de4e66b7 1eb6c478

+4
+4
drivers/crypto/atmel-sha204a.c
··· 106 106 } 107 107 108 108 ret = atmel_i2c_send_receive(client, &cmd); 109 + if (ret < 0) { 110 + dev_err(&client->dev, "failed to read otp at %04X\n", addr); 111 + return ret; 112 + } 109 113 110 114 if (cmd.data[0] == 0xff) { 111 115 dev_err(&client->dev, "failed, device not ready\n");