Author: Charles Manning Date: To: yaffs Subject: [Yaffs] Fix to negative hashing problem
Hi yaffsers
There was a problem whereby negative hash values could get generated.
The way that the crash was manifesting was that a negative tags objectId
(impossible, except by major tags corruption) would create a negative hash
array index. Not a good thing, since it would try treat other memory at
doubly linked lists.
This problem would only occur if the tags got seriously corrupted at the
mtd/flash level, so if you were encountering this one, you'd probably be
getting data loss too. At least now the crash does not happen.
The simple one-liner solution is to just abs() the objectId in the hash
function.
I have committed a change to CVS for both yaffs and yaffs2.