1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Convert a long to rman_res_t, fixing a sign extension bug.

ahci.c had one signed long, which was passed into rman, rather than u_long.
After the switch of rman_res_t from size u_long to size uintmax_t, the sign
extension caused ranges to get messed up, and ahcich* to not attach.

There may be more signed longs used in this way, which will be fixed as they're
reported.

Reported by:	pho
This commit is contained in:
Justin Hibbits 2016-03-20 14:21:07 +00:00
parent 7958a34cb5
commit d6f8b9168f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297065

View File

@ -527,7 +527,7 @@ ahci_alloc_resource(device_t dev, device_t child, int type, int *rid,
{
struct ahci_controller *ctlr = device_get_softc(dev);
struct resource *res;
long st;
rman_res_t st;
int offset, size, unit;
unit = (intptr_t)device_get_ivars(child);