schedule();
continue;
}
-
- comedi_buf_munge(dev, s, n);
+ comedi_buf_munge(dev, s, async->buf_write_count - async->munge_count);
m = copy_to_user(buf, async->prealloc_buf +
async->buf_read_ptr, n);
if(m){
spin_lock_init(&dev->spinlock);
dev->minor=minor;
dev->use_count = use_count;
-
for(driv=comedi_drivers;driv;driv=driv->next){
if(!try_module_get( driv->module ))
{
if( s->munge == NULL || ( s->async->cmd.flags & CMDF_RAWDATA ) )
return count;
-
/* don't munge partial samples */
num_bytes -= num_bytes % bytes_per_sample(s);
while( count < num_bytes )
{
- unsigned int block_size;
+ int block_size;
block_size = num_bytes - count;
+ if(block_size < 0)
+ {
+ rt_printk("%s: %s: bug! block_size is negative\n", __FILE__, __FUNCTION__);
+ break;
+ }
if( (int)(s->async->munge_ptr + block_size - s->async->prealloc_bufsz) > 0 )
block_size = s->async->prealloc_bufsz - s->async->munge_ptr;