Skip to content

Commit af241e6

Browse files
Benjamin-Blockhcahca
authored andcommitted
s390/pci: Annotate lock context imbalance in zpci_release_device()
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>
1 parent 4cb92fa commit af241e6

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

arch/s390/pci/pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,7 @@ void zpci_device_reserved(struct zpci_dev *zdev)
961961
}
962962

963963
void zpci_release_device(struct kref *kref)
964+
__releases(&zpci_list_lock)
964965
{
965966
struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref);
966967

0 commit comments

Comments
 (0)