Commit b17884cc authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman
Browse files

staging: kpc2000: fix error return code in kp2000_pcie_probe()



Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function. Also
removed var 'rv' since we can use 'err' instead.

Fixes: 7dc7967f ("staging: kpc2000: add initial set of Daktronics drivers")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200506134735.102041-1-weiyongjun1@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2ef96a5b
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -298,7 +298,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
{
	int err = 0;
	struct kp2000_device *pcard;
	int rv;
	unsigned long reg_bar_phys_addr;
	unsigned long reg_bar_phys_len;
	unsigned long dma_bar_phys_addr;
@@ -445,11 +444,11 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
	if (err < 0)
		goto err_release_dma;

	rv = request_irq(pcard->pdev->irq, kp2000_irq_handler, IRQF_SHARED,
	err = request_irq(pcard->pdev->irq, kp2000_irq_handler, IRQF_SHARED,
			  pcard->name, pcard);
	if (rv) {
	if (err) {
		dev_err(&pcard->pdev->dev,
			"%s: failed to request_irq: %d\n", __func__, rv);
			"%s: failed to request_irq: %d\n", __func__, err);
		goto err_disable_msi;
	}