Page MenuHomeFreeBSD

umass: fix a leak in error case and enhance debugging
ClosedPublic

Authored by bz on Sep 1 2020, 8:28 PM.
Tags
None
Referenced Files
F169559066: D26287.diff
Tue, Sep 1, 10:18 PM
F169536503: D26287.id76512.diff
Tue, Sep 1, 8:44 PM
F169499744: D26287.diff
Tue, Sep 1, 5:35 PM
F169498453: D26287.id.diff
Tue, Sep 1, 5:27 PM
F169493497: D26287.id76659.diff
Tue, Sep 1, 5:06 PM
Unknown Object (File)
Sun, Aug 30, 9:44 AM
Unknown Object (File)
Mon, Aug 24, 2:03 AM
Unknown Object (File)
Sat, Aug 22, 11:25 AM
Subscribers

Details

Summary

Investigating a hang I found having some more error information
available would be helpful, so be more verbose and also tell cam/xpt
status in case of error/panic.

While chanign I noticed that in case of error in umass_cam_attach_sim()
we miss a cam_sim_free() call. Added that to not leak resources.

Reviewed by: ...
MFC after: 5 days
Test Plan

Not done like this; I have been running this with a direct printf and
not DPRINTF() though.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Sep 1 2020, 8:28 PM
bz created this revision.

In case this is correct, should I commit the missing cam_sim_free() call on its own?

hselasky added inline comments.
sys/dev/usb/storage/umass.c
2110 ↗(On Diff #76512)

I wonder if you should unlock before doing cam_sim_free().

This revision is now accepted and ready to land.Sep 2 2020, 7:25 AM

Thanks!

sys/dev/usb/storage/umass.c
2110 ↗(On Diff #76512)

No, that's the locking guarantee cam_sim.c enforces.

This revision was automatically updated to reflect the committed changes.