PCI: Prevent sysfs disable of device while driver is attached
authorChristoph Hellwig <hch@lst.de>
Fri, 18 May 2018 16:56:24 +0000 (18:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:55:17 +0000 (07:55 +0200)
commitdb16571fb75ba384a21f9e4c370893216224e74c
treee66287a7d76320c76b112767233508efbbffc037
parent7e51effb7a5bc011fe93c7f0c0c67a43f290c5e0
PCI: Prevent sysfs disable of device while driver is attached

[ Upstream commit 6f5cdfa802733dcb561bf664cc89d203f2fd958f ]

Manipulating the enable_cnt behind the back of the driver will wreak
complete havoc with the kernel state, so disallow it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/pci-sysfs.c