Re: [PATCH v2] crypto: atmel-sha204a - Fix OTP sysfs read and error handling

From: Herbert Xu

Date: Sat Feb 28 2026 - 03:49:48 EST


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@xxxxxxxxxxxxxxx
> Fixes: 13909a0c8897 ("crypto: atmel-sha204a - provide the otp content")
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> 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@xxxxxxxxx/
> ---
> drivers/crypto/atmel-sha204a.c | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)

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