File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
drivers/net/wireless/intel/iwlwifi Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -271,6 +271,8 @@ static int iwl_dbg_tlv_alloc_trigger(struct iwl_trans *trans,
271
271
{
272
272
struct iwl_fw_ini_trigger_tlv * trig = (void * )tlv -> data ;
273
273
u32 tp = le32_to_cpu (trig -> time_point );
274
+ struct iwl_ucode_tlv * dup = NULL ;
275
+ int ret ;
274
276
275
277
if (le32_to_cpu (tlv -> length ) < sizeof (* trig ))
276
278
return - EINVAL ;
@@ -283,10 +285,20 @@ static int iwl_dbg_tlv_alloc_trigger(struct iwl_trans *trans,
283
285
return - EINVAL ;
284
286
}
285
287
286
- if (!le32_to_cpu (trig -> occurrences ))
288
+ if (!le32_to_cpu (trig -> occurrences )) {
289
+ dup = kmemdup (tlv , sizeof (* tlv ) + le32_to_cpu (tlv -> length ),
290
+ GFP_KERNEL );
291
+ if (!dup )
292
+ return - ENOMEM ;
293
+ trig = (void * )dup -> data ;
287
294
trig -> occurrences = cpu_to_le32 (-1 );
295
+ tlv = dup ;
296
+ }
297
+
298
+ ret = iwl_dbg_tlv_add (tlv , & trans -> dbg .time_point [tp ].trig_list );
299
+ kfree (dup );
288
300
289
- return iwl_dbg_tlv_add ( tlv , & trans -> dbg . time_point [ tp ]. trig_list ) ;
301
+ return ret ;
290
302
}
291
303
292
304
static int (* dbg_tlv_alloc [])(struct iwl_trans * trans ,
You can’t perform that action at this time.
0 commit comments