rvfree memleak fix
authorDavid Schleef <ds@schleef.org>
Sat, 26 Feb 2000 23:01:13 +0000 (23:01 +0000)
committerDavid Schleef <ds@schleef.org>
Sat, 26 Feb 2000 23:01:13 +0000 (23:01 +0000)
comedi/drivers.c

index 59f5757207831ce16c662630ca07a872ba4bb9f0..d8b5aa7d85c006deeae5dde842171165592cc893 100644 (file)
@@ -183,12 +183,14 @@ static void postconfig(comedi_device *dev)
                if(s->trig[1] || s->trig[2] || s->trig[3] ||s->trig[4])
                        have_trig=1;
 
+#ifdef CONFIG_COMEDI_VER08
                if(s->do_cmd && !have_trig){
                        s->trig[1]=command_trig;
                        s->trig[2]=command_trig;
                        s->trig[3]=command_trig;
                        s->trig[4]=command_trig;
                }
+#endif
                if(s->do_cmd || have_trig){
                        s->prealloc_bufsz=1024*128;
                }else{
@@ -197,7 +199,7 @@ static void postconfig(comedi_device *dev)
 
                if(s->prealloc_bufsz){
                        /* XXX */
-                       s->prealloc_buf=rvmalloc(s->prealloc_bufsz*sizeof(sampl_t));
+                       s->prealloc_buf=rvmalloc(s->prealloc_bufsz);
                        if(!s->prealloc_buf){
                                printk("ENOMEM\n");
                        }