FAILED: patch "[PATCH] crypto: xilinx-trng - Fix return value of" failed to apply to 7.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 7.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-7.1.y
git checkout FETCH_HEAD
git cherry-pick -x 2dd67774228930ccf6441e5628996021f410c4e0
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026071529-proposal-overarch-440e@gregkh' --subject-prefix 'PATCH 7.1.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2dd67774228930ccf6441e5628996021f410c4e0 Mon Sep 17 00:00:00 2001
From: Eric Biggers <[email protected]>
Date: Sun, 31 May 2026 12:17:36 -0700
Subject: [PATCH] crypto: xilinx-trng - Fix return value of
xtrng_hwrng_trng_read()
Implementations of hwrng::read are expected to return the number of bytes generated. Update xtrng_hwrng_trng_read() to match that.
drivers/crypto/xilinx/xilinx-trng.c +6 -3
@@ -239,18 +239,21 @@ static int xtrng_hwrng_trng_read(struct hwrng *hwrng, void *data, size_t max, bo {u8 buf[TRNG_SEC_STRENGTH_BYTES ];struct xilinx_rng *rng; -int ret = -EINVAL , i =0 ; +int ret =0 , i =0 ; rng = container_of(hwrng, struct xilinx_rng, trng);while (i < max) { ret =xtrng_random_bytes_generate (rng, buf,TRNG_SEC_STRENGTH_BYTES , wait); -if (ret <0 ) +if (ret <0 ) { +if (i ==0 ) +return ret;break ; + }memcpy (data + i, buf,min_t (int, ret, (max - i))); i +=min_t (int, ret, (max - i)); } -return ret; +return i; }static int xtrng_hwrng_register (struct hwrng *trng)