Page MenuHomeFreeBSD

Fix bug in xrefinfo_find() for 64-bit platforms
ClosedPublic

Authored by zbb on Mar 27 2015, 10:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 5, 5:06 PM
Unknown Object (File)
Thu, Nov 28, 6:41 AM
Unknown Object (File)
Oct 4 2024, 8:55 AM
Unknown Object (File)
Sep 10 2024, 1:21 PM
Unknown Object (File)
Sep 8 2024, 10:19 PM
Unknown Object (File)
Sep 8 2024, 7:34 AM
Unknown Object (File)
Aug 12 2024, 1:03 AM
Unknown Object (File)
Aug 12 2024, 1:03 AM

Details

Summary

uintptr_t may be 64-bit on some platforms, therefore when
finding xrefinfo by pointer to device the high word is being
cut off due to cast to phandle_t which is 32-bit long by definition.
Due to that we loose the high word of the address to compare with
xi->dev's address.
To fix that, first argument of xrefinfo_find() is extended to
uintptr_t and is being cast to appropriate type (phandle_t)
when compared.

Submitted by: Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

zbb retitled this revision from to Fix bug in xrefinfo_find() for 64-bit platforms.
zbb updated this object.
zbb edited the test plan for this revision. (Show Details)
zbb added reviewers: ian, nwhitehorn.
zbb added subscribers: Unknown Object (MLST), Unknown Object (MLST), PowerPC.
nwhitehorn edited edge metadata.

Looks OK to me. Would be nice if you changed the name of the "phandle" argument to "key" or something since, in the cases where this applies, it isn't a phandle.

This revision is now accepted and ready to land.Mar 27 2015, 6:25 PM