V4L/DVB (6205): pvrusb2: Fix oops in error leg cleanup
authorMike Isely <isely@pobox.com>
Sun, 9 Sep 2007 01:10:11 +0000 (22:10 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 01:14:30 +0000 (22:14 -0300)
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/pvrusb2/pvrusb2-context.c

index 6bbed88..22719ba 100644 (file)
@@ -33,8 +33,10 @@ static void pvr2_context_destroy(struct pvr2_context *mp)
 {
        if (mp->hdw) pvr2_hdw_destroy(mp->hdw);
        pvr2_trace(PVR2_TRACE_STRUCT,"Destroying pvr_main id=%p",mp);
-       flush_workqueue(mp->workqueue);
-       destroy_workqueue(mp->workqueue);
+       if (mp->workqueue) {
+               flush_workqueue(mp->workqueue);
+               destroy_workqueue(mp->workqueue);
+       }
        kfree(mp);
 }