On Tuesday 01 January 2013 22:11:01 Alexey Khoroshilov wrote:You are right! But I would say -ENODEV is more popular error code in this case.If pci_set_dma_mask() or pci_set_consistent_dma_mask() fails in p54p_probe(),Uh, Thanks!
it breaks off initialization, deallocates all resources, but returns zero.
The patch implements proper error code propagation.
But wait, I think there's another return 0 in the error
path. See p54pci.c @ line 558:
mem_len = pci_resource_len(pdev, 0);
if (mem_len < sizeof(...)) {
dev_err(...)
goto err_disabled_dev;
}
Do you think you can add a err = -EINVAL; before the goto too?
[I wonder why this wasn't found by the verification project asActually it was found, but I have no direct access to the results at the moment. My fault.
well? Could it be that pci_resource_len(...) < sizeof(...) is
somehow always true and this is a dead branch?]