aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/firewire
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2014-06-20 01:45:03 +0000
committerAlexander Kabaev <kan@FreeBSD.org>2014-06-20 01:45:03 +0000
commit2d5d61a46d270900ed904ddf1aa7eb04a1cbd3a6 (patch)
tree2a6cedbfa0614b637c91391ad8bacdf746358261 /sys/dev/firewire
parentaa1cb7501fead18583f08c616f38f4a1e89f0e5f (diff)
downloadsrc-2d5d61a46d270900ed904ddf1aa7eb04a1cbd3a6.tar.gz
src-2d5d61a46d270900ed904ddf1aa7eb04a1cbd3a6.zip
Set target->sbp field to valid value when sbp device is created.
The sbp_cam_detach_target can be called from sbp_post_explore function on the first target that is not really attached and it was written with the corresponding safety check in place to tolerate that. Unfortunately the recent locking cleanup did add a locking assertion that tries to dereference the target->sbp pointer unconditionally, which causes less than desirable outcome. Since the assertion is useful, just initialize the target sbp pointer once when sbp device is being initialized instead of when the target is being attached. This makes assertion work in all cases and fixes the crash on boot.
Notes
Notes: svn path=/head/; revision=267660
Diffstat (limited to 'sys/dev/firewire')
-rw-r--r--sys/dev/firewire/sbp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c
index 751d1055d86c..10e8c60eea67 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -622,7 +622,6 @@ END_DEBUG
}
/* new target */
target = &sbp->targets[i];
- target->sbp = sbp;
target->fwdev = fwdev;
target->target_id = i;
/* XXX we may want to reload mgm port after each bus reset */
@@ -1976,6 +1975,7 @@ END_DEBUG
for( i = 0 ; i < SBP_NUM_TARGETS ; i++){
sbp->targets[i].fwdev = NULL;
sbp->targets[i].luns = NULL;
+ sbp->targets[i].sbp = sbp;
}
sbp->sim = cam_sim_alloc(sbp_action, sbp_poll, "sbp", sbp,