[PATCH v2] crypto: atmel-sha204a - Fix OTP sysfs read and error handling
Herbert Xu
herbert at gondor.apana.org.au
Sat Feb 28 00:48:39 PST 2026
On Mon, Feb 16, 2026 at 08:45:51AM +0100, Thorsten Blum wrote:
> Fix otp_show() to read and print all 64 bytes of the OTP zone.
> Previously, the loop only printed half of the OTP (32 bytes), and
> partial output was returned on read errors.
>
> Propagate the actual error from atmel_sha204a_otp_read() instead of
> producing partial output.
>
> Replace sprintf() with sysfs_emit_at(), which is preferred for
> formatting sysfs output because it provides safer bounds checking.
>
> Cc: stable at vger.kernel.org
> Fixes: 13909a0c8897 ("crypto: atmel-sha204a - provide the otp content")
> Signed-off-by: Thorsten Blum <thorsten.blum at linux.dev>
> ---
> Compile-tested only.
>
> Changes in v2:
> - Return the total number of bytes written by sysfs_emit_at() after
> feedback from Lothar (thanks!)
> - Link to v1: https://lore.kernel.org/lkml/20260215124125.465162-2-thorsten.blum@linux.dev/
> ---
> drivers/crypto/atmel-sha204a.c | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
More information about the linux-arm-kernel
mailing list