In the event that the ID command timed out, mps(4) did not free the command
until it could be cancelled. However, it freed the associated buffer
(cm_data). Fix the lifetime issue by freeing the associated buffer at the
same time as the command.
Details
Details
I have not tested this at all, other than compiling.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
My remaining concern is this may leak if the controller is reinited for some unrelated reason. That should not be the ordinary case, but maybe it is possible. I think that could be fixed by something like the following in mps_sas.c:mpssas_complete_all_commands():
+if (cm->cm_flags & MPS_CM_FLAGS_SATA_ID_TIMEOUT) + free(cm->cm_data, ...);
Does that seem ok?
Comment Actions
Ditto the other review — I'd be happy to, but I have a weak preference for getting to "accept" quality on mps alone first and then copying to mpr once, rather than reviewing two sets of changes and applying any fixups twice. It's just less work for me. If you still prefer both at the same time, I am willing to do that.
Comment Actions
Copy to mpr(4); add seatbelt check in mp?sas_complete_all_commands() in case of reinit