V4L/DVB (5078): Pvrusb2: It's safe to kfree() a null pointer
authorMike Isely <isely@pobox.com>
Sat, 20 Jan 2007 03:02:26 +0000 (00:02 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 21 Feb 2007 15:34:37 +0000 (13:34 -0200)
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/pvrusb2/pvrusb2-v4l2.c

index 0ecad5b3c02960b48caa73738e331c40cef9b8ec..4c2e4defd71e80218384fd027e3e1b657f94f5e8 100644 (file)
@@ -1189,8 +1189,8 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp)
        vp->dev_video = kmalloc(sizeof(*vp->dev_video),GFP_KERNEL);
        vp->dev_radio = kmalloc(sizeof(*vp->dev_radio),GFP_KERNEL);
        if (!(vp->dev_video && vp->dev_radio)) {
-               if (vp->dev_video) kfree(vp->dev_video);
-               if (vp->dev_radio) kfree(vp->dev_radio);
+               kfree(vp->dev_video);
+               kfree(vp->dev_radio);
                kfree(vp);
                return NULL;
        }