summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Erik Hovland 2008-09-30 14:05:32 -0700
committerGravatar Dan Dennedy 2008-10-28 22:52:29 -0700
commit8ad324c971a14753c35f6135fa44dfe3c1a4bf82 (patch)
treee68d775ac20c8718898c3431f2fcb06becd5ce44 /src
parentProtect against resource leaks. (diff)
Compare unsigned values instead of subtracting them.
Unsigned values do not return signed values when subtracted and the right operand is larger then the left operand. Signed-off-by: Dan Dennedy <dan@dennedy.org>
Diffstat (limited to 'src')
-rw-r--r--src/fw.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fw.c b/src/fw.c
index a229d1a..9c0c2e9 100644
--- a/src/fw.c
+++ b/src/fw.c
@@ -1310,9 +1310,10 @@ fw_bandwidth_modify (raw1394handle_t handle,
compare = ntohl (buffer);
switch (mode) {
case RAW1394_MODIFY_ALLOC:
- swap = compare - bandwidth;
- if (swap < 0)
+ if (compare < bandwidth)
return -1;
+
+ swap = compare - bandwidth;
break;
case RAW1394_MODIFY_FREE:
/td>-39/+161 2003-01-15implement tag matching for rawiso receptionGravatar dmaas 3-4/+12 2003-01-06back out previous commit - don't drop the legacy API just yetGravatar dmaas 6-173/+130 2003-01-05emulate legacy ISO reception API on top of new rawiso APIGravatar dmaas 7-131/+174 2002-12-24update iso API for multi-channel reception and new packet buffer layoutGravatar dmaas 4-123/+236 2002-12-20oops, irq_interval needs to be signedGravatar anonymous 1-1/+1 2002-12-20dmaas - renamed exported arm definitions into the raw1394_ namespace; brought...Gravatar anonymous 3-124/+48 2002-12-16rawiso updates:Gravatar dmaas 3-18/+25 2002-11-18fix cplusplus extern C blockGravatar ddennedy 1-4/+4 2002-11-18merged rawiso branchGravatar ddennedy 7-6/+488