[media] media: video: pvrusb2: fix memory leak
Vasiliy Kulikov [Fri, 19 Nov 2010 18:41:49 +0000 (15:41 -0300)]
Use put_device() instead of kfree() because of device name leak.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

drivers/media/video/pvrusb2/pvrusb2-sysfs.c

index 3d7e5aa..281806b 100644 (file)
@@ -647,7 +647,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
        if (ret) {
                pvr2_trace(PVR2_TRACE_ERROR_LEGS,
                           "device_register failed");
-               kfree(class_dev);
+               put_device(class_dev);
                return;
        }