]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/pvrusb2/pvrusb2-ioread.c
Merge git://git.infradead.org/~kmpark/onenand-mtd-2.6
[linux-2.6-omap-h63xx.git] / drivers / media / video / pvrusb2 / pvrusb2-ioread.c
index f7a2e225a002543287f171d00a91589b0877bcb6..f782418afa45db71c6a07e27382db0e5a5637b3e 100644 (file)
@@ -87,10 +87,9 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp)
 struct pvr2_ioread *pvr2_ioread_create(void)
 {
        struct pvr2_ioread *cp;
-       cp = kmalloc(sizeof(*cp),GFP_KERNEL);
+       cp = kzalloc(sizeof(*cp),GFP_KERNEL);
        if (!cp) return NULL;
        pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp);
-       memset(cp,0,sizeof(*cp));
        if (pvr2_ioread_init(cp) < 0) {
                kfree(cp);
                return NULL;
@@ -213,7 +212,9 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp)
                                   " pvr2_ioread_setup (tear-down) id=%p",cp);
                        pvr2_ioread_stop(cp);
                        pvr2_stream_kill(cp->stream);
-                       pvr2_stream_set_buffer_count(cp->stream,0);
+                       if (pvr2_stream_get_buffer_count(cp->stream)) {
+                               pvr2_stream_set_buffer_count(cp->stream,0);
+                       }
                        cp->stream = NULL;
                }
                if (sp) {
@@ -251,7 +252,6 @@ int pvr2_ioread_set_enabled(struct pvr2_ioread *cp,int fl)
        return ret;
 }
 
-
 static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
 {
        int stat;