Replace direct structure assignment with explicit copying to prevent
potential undefined behavior from structure aliasing. This ensures
proper memory handling when working with sanlock structures.
This possibly fixes regression introduced with commit:
e9640e5178769
as unintended side effect.
if (!res_args)
return -ENOMEM;
- memcpy(&rd1, &rds->rs, sizeof(struct rd_sanlock));
- memcpy(&rd2, &rds->rs, sizeof(struct rd_sanlock));
+ rd1.rs = rds->rs;
+ rd2.rs = rds->rs;
res1 = &rd1.rs;
res2 = &rd2.rs;