Description of the false positive
https://github.com/ryao/zfs/security/code-scanning/694
https://github.com/ryao/zfs/blob/15e39c6d547afb7e8df515582516f318dd5d0183/lib/libzpool/kernel.c#L1205-L1205
CodeQL complains that done is potentially uninitialized. However, done is set when rc != -1, so it is only uninitialized when rc == -1. Then the function terminates when rc < 0 before reaching the line where done is used. There is no path that can reach that line that leaves done uninitialized. Therefore, this is a false positive.
Description of the false positive
https://github.com/ryao/zfs/security/code-scanning/694
https://github.com/ryao/zfs/blob/15e39c6d547afb7e8df515582516f318dd5d0183/lib/libzpool/kernel.c#L1205-L1205
CodeQL complains that
doneis potentially uninitialized. However,doneis set whenrc != -1, so it is only uninitialized whenrc == -1. Then the function terminates whenrc < 0before reaching the line wheredoneis used. There is no path that can reach that line that leavesdoneuninitialized. Therefore, this is a false positive.