@@ -73,24 +73,25 @@ static int try_cancel_split_timeout(struct fw_transaction *t)
7373static int close_transaction (struct fw_transaction * transaction ,
7474 struct fw_card * card , int rcode )
7575{
76- struct fw_transaction * t ;
76+ struct fw_transaction * t = NULL , * iter ;
7777 unsigned long flags ;
7878
7979 spin_lock_irqsave (& card -> lock , flags );
80- list_for_each_entry (t , & card -> transaction_list , link ) {
81- if (t == transaction ) {
82- if (!try_cancel_split_timeout (t )) {
80+ list_for_each_entry (iter , & card -> transaction_list , link ) {
81+ if (iter == transaction ) {
82+ if (!try_cancel_split_timeout (iter )) {
8383 spin_unlock_irqrestore (& card -> lock , flags );
8484 goto timed_out ;
8585 }
86- list_del_init (& t -> link );
87- card -> tlabel_mask &= ~(1ULL << t -> tlabel );
86+ list_del_init (& iter -> link );
87+ card -> tlabel_mask &= ~(1ULL << iter -> tlabel );
88+ t = iter ;
8889 break ;
8990 }
9091 }
9192 spin_unlock_irqrestore (& card -> lock , flags );
9293
93- if (& t -> link != & card -> transaction_list ) {
94+ if (t ) {
9495 t -> callback (card , rcode , NULL , 0 , t -> callback_data );
9596 return 0 ;
9697 }
@@ -935,7 +936,7 @@ EXPORT_SYMBOL(fw_core_handle_request);
935936
936937void fw_core_handle_response (struct fw_card * card , struct fw_packet * p )
937938{
938- struct fw_transaction * t ;
939+ struct fw_transaction * t = NULL , * iter ;
939940 unsigned long flags ;
940941 u32 * data ;
941942 size_t data_length ;
@@ -947,20 +948,21 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
947948 rcode = HEADER_GET_RCODE (p -> header [1 ]);
948949
949950 spin_lock_irqsave (& card -> lock , flags );
950- list_for_each_entry (t , & card -> transaction_list , link ) {
951- if (t -> node_id == source && t -> tlabel == tlabel ) {
952- if (!try_cancel_split_timeout (t )) {
951+ list_for_each_entry (iter , & card -> transaction_list , link ) {
952+ if (iter -> node_id == source && iter -> tlabel == tlabel ) {
953+ if (!try_cancel_split_timeout (iter )) {
953954 spin_unlock_irqrestore (& card -> lock , flags );
954955 goto timed_out ;
955956 }
956- list_del_init (& t -> link );
957- card -> tlabel_mask &= ~(1ULL << t -> tlabel );
957+ list_del_init (& iter -> link );
958+ card -> tlabel_mask &= ~(1ULL << iter -> tlabel );
959+ t = iter ;
958960 break ;
959961 }
960962 }
961963 spin_unlock_irqrestore (& card -> lock , flags );
962964
963- if (& t -> link == & card -> transaction_list ) {
965+ if (! t ) {
964966 timed_out :
965967 fw_notice (card , "unsolicited response (source %x, tlabel %x)\n" ,
966968 source , tlabel );
0 commit comments