]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390/pci: Annotate lock context imbalance in zpci_release_device()
authorBenjamin Block <bblock@linux.ibm.com>
Fri, 5 Dec 2025 15:47:18 +0000 (16:47 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Sun, 14 Dec 2025 10:03:58 +0000 (11:03 +0100)
When checking `arch/s390/pci/pci.c` with `sparse` during build, the
following complaint is reported:

  arch/s390/pci/pci.c: note: in included file (through include/linux/smp.h, include/linux/lockdep.h, include/linux/spinlock.h, include/linux/mmzone.h, include/linux/gfp.h, include/linux/slab.h):
  ./include/linux/list.h:237:25: warning: context imbalance in 'zpci_release_device' - unexpected unlock

But this is expected, as zpci_release_device() is expected to be called
with `zpci_list_lock` held, as part of `kref_put_lock()` or similar.

Reflect this by annotating the function with the appropriate
__releases().

Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/pci/pci.c

index 8fd14d0430085dd7a121adf2c15a3cf93f1fc422..57f3980b98a927a417fa378fbd3e488994c36492 100644 (file)
@@ -961,6 +961,7 @@ void zpci_device_reserved(struct zpci_dev *zdev)
 }
 
 void zpci_release_device(struct kref *kref)
+       __releases(&zpci_list_lock)
 {
        struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref);