summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5951aec)
raw | patch | inline | side by side (parent: 5951aec)
author | Sam Nelson <sam.nelson@ti.com> | |
Sat, 5 Oct 2019 03:27:53 +0000 (23:27 -0400) | ||
committer | Sam Nelson <sam.nelson@ti.com> | |
Sat, 5 Oct 2019 15:17:45 +0000 (11:17 -0400) |
Convert to common unsigned int
Also add error check where needed
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Also add error check where needed
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
packages/ti/ipc/family/tci6614/VirtQueue.c | patch | blob | history | |
packages/ti/ipc/family/tci6638/VirtQueue.c | patch | blob | history | |
packages/ti/ipc/family/vayu/VirtQueue.c | patch | blob | history |
diff --git a/packages/ti/ipc/family/tci6614/VirtQueue.c b/packages/ti/ipc/family/tci6614/VirtQueue.c
index 286cb5f53fe793be50e1f80f7bae62d482176328..c8e0f5b91c1a4ad2dc5f95ede901da624a968d79 100644 (file)
/*
/*
- * Copyright (c) 2011-2015 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (c) 2011-2019 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
IArg key;
key = GateAll_enter(vq->gateH);
IArg key;
key = GateAll_enter(vq->gateH);
- if ((head > vring->num) || (head < 0)) {
+ if (((unsigned int)head > vring->num) || (head < 0)) {
Error_raise(NULL, Error_E_generic, 0, 0);
}
else {
Error_raise(NULL, Error_E_generic, 0, 0);
}
else {
diff --git a/packages/ti/ipc/family/tci6638/VirtQueue.c b/packages/ti/ipc/family/tci6638/VirtQueue.c
index d4c9cdf86581e8d1d8c48d1dc52a739e0367641f..804bf48059e1e10d4964ece36726761a8528a72b 100644 (file)
/*
/*
- * Copyright (c) 2011-2018 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (c) 2011-2019 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
IArg key;
key = GateAll_enter(vq->gateH);
IArg key;
key = GateAll_enter(vq->gateH);
- if ((head > vring->num) || (head < 0)) {
+ if (((unsigned int)head > vring->num) || (head < 0)) {
Error_raise(NULL, Error_E_generic, 0, 0);
}
else {
Error_raise(NULL, Error_E_generic, 0, 0);
}
else {
index e36666b9b438c80f68373319d0b9b898b701d815..f4c52a03ba8f449ca70c7949ce31095bf9d5377f 100644 (file)
/*
/*
- * Copyright (c) 2011-2015 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (c) 2011-2019 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
/* register with xdc.runtime to get a diags mask */
result = Registry_addModule(&Registry_CURDESC, MODULE_NAME);
Assert_isTrue(result == Registry_SUCCESS, (Assert_Id)NULL);
/* register with xdc.runtime to get a diags mask */
result = Registry_addModule(&Registry_CURDESC, MODULE_NAME);
Assert_isTrue(result == Registry_SUCCESS, (Assert_Id)NULL);
+ /* Double check , In case Assert is disabled */
+ if (result != Registry_SUCCESS) {
+ return;
+ }
initialized = 1;
}
initialized = 1;
}
IArg key;
key = GateHwi_enter(vq->gateH);
IArg key;
key = GateHwi_enter(vq->gateH);
- if ((head > vq->vring.num) || (head < 0)) {
+ if (((unsigned int)head > vq->vring.num) || (head < 0)) {
GateHwi_leave(vq->gateH, key);
Error_raise(NULL, Error_E_generic, 0, 0);
}
GateHwi_leave(vq->gateH, key);
Error_raise(NULL, Error_E_generic, 0, 0);
}
@@ -458,6 +462,9 @@ VirtQueue_Handle VirtQueue_create(UInt16 remoteProcId, VirtQueue_Params *params,
result = Resource_physToVirt(vq->basePa, &(vq->baseVa));
Assert_isTrue(result == Resource_S_SUCCESS, (Assert_Id)NULL);
result = Resource_physToVirt(vq->basePa, &(vq->baseVa));
Assert_isTrue(result == Resource_S_SUCCESS, (Assert_Id)NULL);
+ if (result != Resource_S_SUCCESS) {
+ return NULL;
+ }
vringAddr = (Void *)vq->baseVa;
break;
vringAddr = (Void *)vq->baseVa;
break;