Skip to contentSkip to conversation

Error handling in drivers/pci/host/pci-dra7xx.c

DISCUSSION Christophe JAILLET 1 participant 2 messages Jul 13, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

in file 'drivers/pci/host/pci-dra7xx.c', error handling in 'dra7xx_pcie_init_irq_domain()' seams to be broken.

The pattern used is:

    if (!var) {
       ...
       dev_err(...);
       return PTR_ERR(var);
    }

so we always return '0', which means success.

Returning PTR_ERR(-EINVAL) or PTR_ERR(-ENODEV) could be, IMHO, better.

Best regards,

CJ

#1 lore raw

(resent because of broken cc)

Hi,

in file 'drivers/pci/host/pci-dra7xx.c', error handling in 'dra7xx_pcie_init_irq_domain()' seams to be broken.

The pattern used is:

    if (!var) {
       ...
       dev_err(...);
       return PTR_ERR(var);
    }

so we always return '0', which means success.

Returning PTR_ERR(-EINVAL) or PTR_ERR(-ENODEV) could be, IMHO, better.

Best regards,

CJ