diff options
author | mav <mav@FreeBSD.org> | 2012-06-21 15:14:51 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2012-06-21 15:14:51 +0000 |
commit | b8ac542c351c0aeaf6e9b5c473e66d4f3195dcc8 (patch) | |
tree | 9b1ba690a4cfad3f98e41be3048b3b526a3c21e7 /sys/cam | |
parent | a632fb1531c5c06b7b1317b3ae558e9347801881 (diff) | |
download | FreeBSD-src-b8ac542c351c0aeaf6e9b5c473e66d4f3195dcc8.zip FreeBSD-src-b8ac542c351c0aeaf6e9b5c473e66d4f3195dcc8.tar.gz |
Make cam_periph_hold() behavior consistent: drop taken reference and
return ENXIO if periph was invalidated while we were waiting for it.
MFC after: 1 week
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/cam_periph.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index b528161..5df9f5b 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -440,6 +440,10 @@ cam_periph_hold(struct cam_periph *periph, int priority) cam_periph_release_locked(periph); return (error); } + if (periph->flags & CAM_PERIPH_INVALID) { + cam_periph_release_locked(periph); + return (ENXIO); + } } periph->flags |= CAM_PERIPH_LOCKED; |