Thread: [Linux1394-cvslog] rev 767 - branches/linux-2.4
Brought to you by:
aeb,
bencollins
From: SVN U. <ben...@li...> - 2003-02-04 08:01:04
|
Author: bencollins Date: 2003-02-04 03:00:31 -0500 (Tue, 04 Feb 2003) New Revision: 767 Modified: branches/linux-2.4/pcilynx.c Log: Merge patch from Alan Cox sent to 2.4 BK tree. Modified: branches/linux-2.4/pcilynx.c ============================================================================== --- branches/linux-2.4/pcilynx.c (original) +++ branches/linux-2.4/pcilynx.c 2003-02-04 03:00:32.000000000 -0500 @@ -974,21 +974,13 @@ ssize_t retval; void *membase; - if (*offset != off) /* Check for EOF before we trust wrap */ - return 0; - - /* FIXME: Signed wrap is undefined in C - wants fixing up */ - if (off + count > off) - return 0; - - if ((off + count) > PCILYNX_MAX_MEMORY + 1) { - count = PCILYNX_MAX_MEMORY + 1 - off; + if ((off + count) > PCILYNX_MAX_MEMORY+1) { + count = PCILYNX_MAX_MEMORY+1 - off; } - if (count == 0) { - return 0; + if (count == 0 || off > PCILYNX_MAX_MEMORY) { + return -ENOSPC; } - switch (md->type) { case rom: membase = md->lynx->local_rom; |