mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +02:00
platform/x86/intel/pmt: re-order trigger logic
Setting the clear bit or checking the complete bit before checking to see if crashlog is disabled seems incorrect. Check disable before accessing any other bits. Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Link: https://lore.kernel.org/r/20250713172943.7335-8-michael.j.ruhl@intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
4f8fa22d10
commit
147c18d8ef
|
|
@ -193,6 +193,10 @@ trigger_store(struct device *dev, struct device_attribute *attr,
|
|||
|
||||
guard(mutex)(&entry->control_mutex);
|
||||
|
||||
/* if device is currently disabled, return busy */
|
||||
if (pmt_crashlog_disabled(&entry->entry))
|
||||
return -EBUSY;
|
||||
|
||||
if (!trigger) {
|
||||
pmt_crashlog_set_clear(&entry->entry);
|
||||
return count;
|
||||
|
|
@ -202,10 +206,6 @@ trigger_store(struct device *dev, struct device_attribute *attr,
|
|||
if (pmt_crashlog_complete(&entry->entry))
|
||||
return -EEXIST;
|
||||
|
||||
/* if device is currently disabled, return busy */
|
||||
if (pmt_crashlog_disabled(&entry->entry))
|
||||
return -EBUSY;
|
||||
|
||||
pmt_crashlog_set_execute(&entry->entry);
|
||||
|
||||
return count;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user