Skip to content

Commit

Permalink
can: c_can_pci: enable PCI bus master only for MSI
Browse files Browse the repository at this point in the history
Coverity complains that c_can_pci_probe() calls pci_enable_msi() without
checking the result:

CID 712278 (#1 of 1): Unchecked return value (CHECKED_RETURN) 3. check_return:
Calling pci_enable_msi_block without checking return value (as is done
elsewhere 88 out of 105 times).
 88        pci_enable_msi(pdev);

This is CID 712278.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Reported-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Wolfgang Grandegger authored and Marc Kleine-Budde committed Apr 24, 2014
1 parent f323d7a commit 78c181b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/can/c_can/c_can_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ static int c_can_pci_probe(struct pci_dev *pdev,
goto out_disable_device;
}

pci_set_master(pdev);
pci_enable_msi(pdev);
ret = pci_enable_msi(pdev);
if (!ret) {
dev_info(&pdev->dev, "MSI enabled\n");
pci_set_master(pdev);
}

addr = pci_iomap(pdev, 0, pci_resource_len(pdev, 0));
if (!addr) {
Expand Down

0 comments on commit 78c181b

Please sign in to comment.