]> git.baikalelectronics.ru Git - kernel.git/commit
misc: pci_endpoint_test: Avoid triggering a BUG()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 30 Sep 2017 08:16:51 +0000 (11:16 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 31 Oct 2017 20:33:39 +0000 (15:33 -0500)
commit524113ed2cc2b471d0a57d0f2cee3db8b2e14835
tree369999c8503fa875edfb12db66f23a9a42147944
parentb84a73bcadf81c84ddf07fc52cb49cd101f9d7a7
misc: pci_endpoint_test: Avoid triggering a BUG()

If you call ida_simple_remove(&pci_endpoint_test_ida, id) with a negative
"id" then it triggers an immediate BUG_ON().  Let's not allow that.

Fixes: 8e13375568f6 ("misc: Add host side PCI driver for PCI test function device")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/misc/pci_endpoint_test.c