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
Unknown Object (File)
Dec 20 2023, 3:24 AM
Unknown Object (File)
May 5 2023, 3:15 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.