Hi Herbert,
On 2/1/23 5:21 PM, Herbert Xu wrote:
On Wed, Feb 01, 2023 at 05:15:23PM +0800, Tianjia Zhang wrote:
According to your previous reply, walker will ensure that the nbytes of
each iteration is at least the size of the chunk. If walk.nbytes == 0,
walk.nbytes == 0 is used to indicate error. Of course you could
check for an error return in addition to checking walk.nbytes but
that's how this bug got created in the first place.
So always check for walk.nbytes == 0.
Cheers,
It seems that only need to fix the loop condition, so if change the
loop condition of the code just now to
while (walk.nbytes && walk.nbytes != walk.total), in this way, the
last chunk cryption is separated out of the loop, which will be clearer
logically. What is your opinion?
Thanks,
Tianjia