@@ -193,9 +193,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
193193 atomic_or (ZFCP_STATUS_COMMON_ERP_INUSE ,
194194 & zfcp_sdev -> status );
195195 erp_action = & zfcp_sdev -> erp_action ;
196- memset (erp_action , 0 , sizeof (struct zfcp_erp_action ));
197- erp_action -> port = port ;
198- erp_action -> sdev = sdev ;
196+ WARN_ON_ONCE (erp_action -> port != port );
197+ WARN_ON_ONCE (erp_action -> sdev != sdev );
199198 if (!(atomic_read (& zfcp_sdev -> status ) &
200199 ZFCP_STATUS_COMMON_RUNNING ))
201200 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY ;
@@ -208,8 +207,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
208207 zfcp_erp_action_dismiss_port (port );
209208 atomic_or (ZFCP_STATUS_COMMON_ERP_INUSE , & port -> status );
210209 erp_action = & port -> erp_action ;
211- memset (erp_action , 0 , sizeof ( struct zfcp_erp_action ) );
212- erp_action -> port = port ;
210+ WARN_ON_ONCE (erp_action -> port != port );
211+ WARN_ON_ONCE ( erp_action -> sdev != NULL ) ;
213212 if (!(atomic_read (& port -> status ) & ZFCP_STATUS_COMMON_RUNNING ))
214213 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY ;
215214 break ;
@@ -219,7 +218,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
219218 zfcp_erp_action_dismiss_adapter (adapter );
220219 atomic_or (ZFCP_STATUS_COMMON_ERP_INUSE , & adapter -> status );
221220 erp_action = & adapter -> erp_action ;
222- memset (erp_action , 0 , sizeof (struct zfcp_erp_action ));
221+ WARN_ON_ONCE (erp_action -> port != NULL );
222+ WARN_ON_ONCE (erp_action -> sdev != NULL );
223223 if (!(atomic_read (& adapter -> status ) &
224224 ZFCP_STATUS_COMMON_RUNNING ))
225225 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY ;
@@ -229,7 +229,11 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
229229 return NULL ;
230230 }
231231
232- erp_action -> adapter = adapter ;
232+ WARN_ON_ONCE (erp_action -> adapter != adapter );
233+ memset (& erp_action -> list , 0 , sizeof (erp_action -> list ));
234+ memset (& erp_action -> timer , 0 , sizeof (erp_action -> timer ));
235+ erp_action -> step = ZFCP_ERP_STEP_UNINITIALIZED ;
236+ erp_action -> fsf_req_id = 0 ;
233237 erp_action -> action = need ;
234238 erp_action -> status = act_status ;
235239
0 commit comments