Page MenuHomeFreeBSD

linuxkpi: Fix not-found case of linux_pci_find_irq_dev
ClosedPublic

Authored by cem on Dec 13 2016, 6:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 11 2024, 9:47 PM
Unknown Object (File)
Feb 9 2024, 5:22 PM
Unknown Object (File)
Feb 4 2024, 7:33 AM
Unknown Object (File)
Jan 30 2024, 2:40 AM
Unknown Object (File)
Jan 9 2024, 4:32 AM
Unknown Object (File)
Jan 9 2024, 4:32 AM
Unknown Object (File)
Jan 9 2024, 4:32 AM
Unknown Object (File)
Jan 9 2024, 4:32 AM
Subscribers
None

Details

Summary

Linux list_for_each_entry() does not neccessarily end with the iterator
NULL (it may be an offset from NULL if the list member is not the first
element of the member struct). Also, initialize the iterator variable
to a sane value.

Reported by: Coverity
CID: 1366940

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cem retitled this revision from to linuxkpi: Fix not-found case of linux_pci_find_irq_dev.
cem updated this object.
cem edited the test plan for this revision. (Show Details)
cem added reviewers: adrian, hselasky, kmacy.

.. shouldn't the spin lock be before pdev = ?

-a

Hi,

I'd prefer if we didn't make dependencies on how list.h is implemented. Can you use the following approach?

struct device *retval = NULL;

...

retval = &pdev->dev;
break;

return (retval);

Thank you!

.. shouldn't the spin lock be before pdev = ?

Shouldn't matter — the list head doesn't move.

Hi,

I'd prefer if we didn't make dependencies on how list.h is implemented. Can you use the following approach?

struct device *retval = NULL;

...

retval = &pdev->dev;
break;

return (retval);

Thank you!

Yeah, that's fine (and was the alternate approach I had in mind).

cem edited edge metadata.

Don't depend on linux list implementation.

hselasky edited edge metadata.

Don't forget to MFC to 11/10/9.

This revision is now accepted and ready to land.Dec 13 2016, 7:54 PM
This revision was automatically updated to reflect the committed changes.