Skip to content

Commit 879ede5

Browse files
aradhyab7Thomas Hellström
authored andcommitted
drm/xe: Default auto_link_downgrade status to false
xe_pcode_read() can return back successfully without updating the variable 'val'. This can cause an arbitrary value to show up in the sysfs file. Allow the auto_link_downgrade_status to default to 0 to avoid any arbitrary value from coming up. Fixes: 0e414bf ("drm/xe: Expose PCIe link downgrade attributes") Reviewed-by: Tejas Upadhyay <[email protected]> Signed-off-by: Aradhya Bhatia <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matt Roper <[email protected]> (cherry picked from commit a7f87de) Signed-off-by: Thomas Hellström <[email protected]>
1 parent e22d7ac commit 879ede5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/xe/xe_device_sysfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ auto_link_downgrade_status_show(struct device *dev, struct device_attribute *att
124124
{
125125
struct pci_dev *pdev = to_pci_dev(dev);
126126
struct xe_device *xe = pdev_to_xe_device(pdev);
127-
u32 val;
127+
/* default the auto_link_downgrade status to 0 */
128+
u32 val = 0;
128129
int ret;
129130

130131
xe_pm_runtime_get(xe);

0 commit comments

Comments
 (0)