summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2012-10-12 17:18:24 +0000
committermav <mav@FreeBSD.org>2012-10-12 17:18:24 +0000
commitc5f476d2d7820c7b7b4c31187aa82e69111ec748 (patch)
tree8b5f5e6ab8e907cfbc0b2a9b51189d423ca630e9 /sys/cam/cam_xpt.c
parent6e22acd47bf1dfd002d3a75ebc6decf639036bc5 (diff)
downloadFreeBSD-src-c5f476d2d7820c7b7b4c31187aa82e69111ec748.zip
FreeBSD-src-c5f476d2d7820c7b7b4c31187aa82e69111ec748.tar.gz
Protect xpt_getattr() calls with the SIM lock and assert that.
Submitted by: ken@ (earlier version)
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r--sys/cam/cam_xpt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 374e870..a5ae5bc 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1111,6 +1111,8 @@ xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path)
int ret = -1;
struct ccb_dev_advinfo cdai;
+ mtx_assert(path->bus->sim->mtx, MA_OWNED);
+
memset(&cdai, 0, sizeof(cdai));
xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL);
cdai.ccb_h.func_code = XPT_DEV_ADVINFO;
OpenPOWER on IntegriCloud