mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-25 18:40:19 -04:00
Reset global zero buffer with raid_zero(0) in raid_selftest cleanup
This commit is contained in:
parent
eba07d2173
commit
306f847689
2 changed files with 10 additions and 0 deletions
|
|
@ -779,6 +779,12 @@ int raid_selftest(void)
|
|||
ret = 0;
|
||||
|
||||
bail:
|
||||
/*
|
||||
* Reset the global zero buffer so that it does not point to
|
||||
* the deallocated memory.
|
||||
*/
|
||||
raid_zero(0);
|
||||
|
||||
free(v);
|
||||
free(v_alloc);
|
||||
|
||||
|
|
|
|||
|
|
@ -161,6 +161,10 @@ int raid_mode(int mode);
|
|||
* The test modifies global RAID state and must not be called concurrently
|
||||
* with any other RAID function.
|
||||
*
|
||||
* The test resets the zero buffer to 0 via raid_zero(0) upon completion.
|
||||
* A valid zero buffer must be set with raid_zero() afterwards before calling
|
||||
* recovery functions (raid_rec(), raid_data()).
|
||||
*
|
||||
* It returns 0 on success.
|
||||
*/
|
||||
int raid_selftest(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue