Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid calling rw_destroy() on uninitialized rwlock
First the function `memset(&key, 0, ...)` but any call to "goto error;" would call zio_crypt_key_destroy(key) which calls `rw_destroy()`. The `rw_init()` is moved up to be right after the memset. This way the rwlock can be released. The ctx does allocate memory, but that is handled by the memset to 0 and icp skips NULL ptrs. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes openzfs#13976
- Loading branch information