aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/sbp2.c
diff options
context:
space:
mode:
authorJody McIntyre <scjody@steamballoon.com>2005-11-07 06:29:39 -0500
committerJody McIntyre <scjody@modernduck.com>2005-11-07 06:29:39 -0500
commit7945619794314414a5c44df11fca4d3f2a3389cf (patch)
tree0252189ea84abaf13ff35af0a18ceda9d457b0a3 /drivers/ieee1394/sbp2.c
parent0b154bb7d0cce80e9c0bcf11d4f9e71b59409d26 (diff)
sbp2_command_orb_lock must be held when accessing the _orb_inuse list.
Fixes an oops in sbp2util_find_command_for_SCpnt after sbp2scsi_abort: https://bugzilla.novell.com/show_bug.cgi?id=113734 Signed-off-by: Jody McIntyre <scjody@steamballoon.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/sbp2.c')
-rw-r--r--drivers/ieee1394/sbp2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 12cec7c4a342..f7e18ccc5c0a 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -2350,6 +2350,7 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int dest
2350 struct scsi_cmnd *SCpnt = NULL; 2350 struct scsi_cmnd *SCpnt = NULL;
2351 u32 scsi_status = SBP2_SCSI_STATUS_GOOD; 2351 u32 scsi_status = SBP2_SCSI_STATUS_GOOD;
2352 struct sbp2_command_info *command; 2352 struct sbp2_command_info *command;
2353 unsigned long flags;
2353 2354
2354 SBP2_DEBUG("sbp2_handle_status_write"); 2355 SBP2_DEBUG("sbp2_handle_status_write");
2355 2356
@@ -2451,9 +2452,11 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int dest
2451 * null out last orb so that next time around we write directly to the orb pointer... 2452 * null out last orb so that next time around we write directly to the orb pointer...
2452 * Quick start saves one 1394 bus transaction. 2453 * Quick start saves one 1394 bus transaction.
2453 */ 2454 */
2455 spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags);
2454 if (list_empty(&scsi_id->sbp2_command_orb_inuse)) { 2456 if (list_empty(&scsi_id->sbp2_command_orb_inuse)) {
2455 scsi_id->last_orb = NULL; 2457 scsi_id->last_orb = NULL;
2456 } 2458 }
2459 spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags);
2457 2460
2458 } else { 2461 } else {
2459 2462
@@ -2563,9 +2566,11 @@ static void sbp2scsi_complete_all_commands(struct scsi_id_instance_data *scsi_id
2563 struct sbp2scsi_host_info *hi = scsi_id->hi; 2566 struct sbp2scsi_host_info *hi = scsi_id->hi;
2564 struct list_head *lh; 2567 struct list_head *lh;
2565 struct sbp2_command_info *command; 2568 struct sbp2_command_info *command;
2569 unsigned long flags;
2566 2570
2567 SBP2_DEBUG("sbp2scsi_complete_all_commands"); 2571 SBP2_DEBUG("sbp2scsi_complete_all_commands");
2568 2572
2573 spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags);
2569 while (!list_empty(&scsi_id->sbp2_command_orb_inuse)) { 2574 while (!list_empty(&scsi_id->sbp2_command_orb_inuse)) {
2570 SBP2_DEBUG("Found pending command to complete"); 2575 SBP2_DEBUG("Found pending command to complete");
2571 lh = scsi_id->sbp2_command_orb_inuse.next; 2576 lh = scsi_id->sbp2_command_orb_inuse.next;
@@ -2582,6 +2587,7 @@ static void sbp2scsi_complete_all_commands(struct scsi_id_instance_data *scsi_id
2582 command->Current_done(command->Current_SCpnt); 2587 command->Current_done(command->Current_SCpnt);
2583 } 2588 }
2584 } 2589 }
2590 spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags);
2585 2591
2586 return; 2592 return;
2587} 2593}