HomeFreeBSD

cam_xpt: Properly fail if a sim uses an unsupported transport.

Description

cam_xpt: Properly fail if a sim uses an unsupported transport.

The default xport ops for a new bus is xport_default, not NULL, so
check for that when determining if a bus failed to find a suitable
transport. In addition, the path needs to be freed with xpt_free_path
instead of a plain free so that the path's reference on the sim is
dropped; otherwise, cam_sim_free in the caller after xpt_bus_register
returns failure will hang forever.

Note that we have to exempt the xpt bus from this check as it uses
xport_default on purpose.

Reviewed by: mav, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D40617

Details

Provenance
jhbAuthored on Jun 27 2023, 3:33 AM
Reviewer
mav
Differential Revision
D40617: cam_xpt: Properly fail if a sim uses an unsupported transport.
Parents
rG9c2203a691ba: nvme: Tidy up transfer rate settings in XPT_GET_TRAN_SETTINGS.
Branches
Unknown
Tags
Unknown