Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PCI/AER: Use guard() in cxl_rch_handle_error_iter()

cxl_rch_handle_error_iter() includes a call to device_lock() using a goto
for multiple return paths. Improve readability and maintainability by
using the guard() lock variant.

Signed-off-by: Terry Bowman <terry.bowman@amd.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260114182055.46029-13-terry.bowman@amd.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>

authored by

Terry Bowman and committed by
Dave Jiang
da71bd36 59010029

+2 -4
+2 -4
drivers/pci/pcie/aer_cxl_rch.c
··· 42 42 if (!is_cxl_mem_dev(dev) || !cxl_error_is_native(dev)) 43 43 return 0; 44 44 45 - device_lock(&dev->dev); 45 + guard(device)(&dev->dev); 46 46 47 47 err_handler = dev->driver ? dev->driver->err_handler : NULL; 48 48 if (!err_handler) 49 - goto out; 49 + return 0; 50 50 51 51 if (info->severity == AER_CORRECTABLE) { 52 52 if (err_handler->cor_error_detected) ··· 57 57 else if (info->severity == AER_FATAL) 58 58 err_handler->error_detected(dev, pci_channel_io_frozen); 59 59 } 60 - out: 61 - device_unlock(&dev->dev); 62 60 return 0; 63 61 } 64 62