return 0;
}
+
/*===========================================================================*
* umap_local *
*===========================================================================*/
*/
if (bytes <= 0) return( (phys_bytes) 0);
+ if (vir_addr + bytes <= vir_addr) return 0; /* overflow */
vc = (vir_addr + bytes - 1) >> CLICK_SHIFT; /* last click of data */
#if (CHIP == INTEL) || (CHIP == M68000)
if((vir_addr>>CLICK_SHIFT) >= rp->p_memmap[seg].mem_vir +
rp->p_memmap[seg].mem_len) return( (phys_bytes) 0 );
+
+ if(vc >= rp->p_memmap[seg].mem_vir +
+ rp->p_memmap[seg].mem_len) return( (phys_bytes) 0 );
+
#if (CHIP == INTEL)
seg_base = (phys_bytes) rp->p_memmap[seg].mem_phys;
seg_base = seg_base << CLICK_SHIFT; /* segment origin in bytes */
#endif
}
-
/*==========================================================================*
* numap_local *
*==========================================================================*/