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
F103261321: D8780.id.diff
Fri, Nov 22, 6:42 PM
Unknown Object (File)
Fri, Nov 15, 6:24 AM
Unknown Object (File)
Thu, Nov 14, 1:30 AM
Unknown Object (File)
Mon, Nov 11, 3:37 PM
Unknown Object (File)
Mon, Nov 4, 8:45 AM
Unknown Object (File)
Wed, Oct 30, 3:18 AM
Unknown Object (File)
Oct 10 2024, 5:34 PM
Unknown Object (File)
Oct 4 2024, 3:34 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.