diff options
author | Alexander Motin <mav@FreeBSD.org> | 2013-10-22 12:58:22 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2013-10-22 12:58:22 +0000 |
commit | 8ec5ab3f1620aca1befd26544299f23b926e98ae (patch) | |
tree | 974b57bcf2d078145b02b9eeb3eebcc37f080619 /sys/cam/cam_xpt.c | |
parent | 7ef4b2a5de3e5038651404ab5f9530020daaaab1 (diff) | |
download | src-8ec5ab3f1620aca1befd26544299f23b926e98ae.tar.gz src-8ec5ab3f1620aca1befd26544299f23b926e98ae.zip |
Unconditionally acquire periph reference on CCB allocation failure.
cam_periph_acquire() can return error if periph already invalidated, but
that may be unacceptable and cause deadlock if the invalidated periph can't
be destroyed without "executing" the scheduled request.
Coverity CID: 1109822
MFC after: 2 months
Notes
Notes:
svn path=/head/; revision=256888
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r-- | sys/cam/cam_xpt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 8d635e881070..f241bbcd3ba3 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -3163,10 +3163,11 @@ restart: ccb = xpt_get_ccb(periph); goto restart; } - if (periph->flags & CAM_PERIPH_RUN_TASK) { + if (periph->flags & CAM_PERIPH_RUN_TASK) break; - } - cam_periph_acquire(periph); + xpt_lock_buses(); + periph->refcount++; /* Unconditionally acquire */ + xpt_unlock_buses(); periph->flags |= CAM_PERIPH_RUN_TASK; taskqueue_enqueue(xsoftc.xpt_taskq, &periph->periph_run_task); |