[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-head
Subject:    V4L/DVB (11516): drivers/media/video/saa5246a.c: fix use-after-free
From:       Linux Kernel Mailing List <linux-kernel () vger ! kernel ! org>
Date:       2009-04-30 4:59:08
Message-ID: 200904300459.n3U4x8dM010894 () hera ! kernel ! org
[Download RAW message or body]

Gitweb:     http://git.kernel.org/linus/9401608bb34be14960311dbb91d4a82ee07a03fa
Commit:     9401608bb34be14960311dbb91d4a82ee07a03fa
Parent:     5b83cfa98569663b6fa6cda85a1f2fd371a082c7
Author:     Dan Carpenter <error27@gmail.com>
AuthorDate: Tue Apr 14 19:51:30 2009 -0300
Committer:  Mauro Carvalho Chehab <mchehab@redhat.com>
CommitDate: Wed Apr 29 15:41:12 2009 -0300

    V4L/DVB (11516): drivers/media/video/saa5246a.c: fix use-after-free
    
    I lowered the kfree(t) down a couple lines and removed the superflous
    "t->vdev = NULL;"
    
    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/video/saa5246a.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index da47b2f..155804b 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -1092,9 +1092,8 @@ static int saa5246a_probe(struct i2c_client *client,
 	/* Register it */
 	err = video_register_device(t->vdev, VFL_TYPE_VTX, -1);
 	if (err < 0) {
-		kfree(t);
 		video_device_release(t->vdev);
-		t->vdev = NULL;
+		kfree(t);
 		return err;
 	}
 	return 0;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic