From patchwork Sat Mar 20 14:12:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 87132 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2KEI0TE032677 for ; Sat, 20 Mar 2010 14:18:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752792Ab0CTOOz (ORCPT ); Sat, 20 Mar 2010 10:14:55 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:59111 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752606Ab0CTOOy (ORCPT ); Sat, 20 Mar 2010 10:14:54 -0400 Received: from themisto.ext.pengutronix.de ([92.198.50.58] helo=pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.71) (envelope-from ) id 1NszRt-0004E8-Nt; Sat, 20 Mar 2010 15:14:50 +0100 From: Wolfram Sang To: kernel-janitors@vger.kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Mauro Carvalho Chehab , linux-media@vger.kernel.org Date: Sat, 20 Mar 2010 15:12:53 +0100 Message-Id: <1269094385-16114-13-git-send-email-w.sang@pengutronix.de> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1269094385-16114-1-git-send-email-w.sang@pengutronix.de> References: <1269094385-16114-1-git-send-email-w.sang@pengutronix.de> X-SA-Exim-Connect-IP: 92.198.50.58 X-SA-Exim-Mail-From: w.sang@pengutronix.de X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on metis.extern.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=4.5 tests=AWL,BAYES_00, KHOP_SC_TOP_CIDR8,T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham version=3.3.0 Subject: [PATCH 12/24] media/video: fix dangling pointers X-SA-Exim-Version: 4.2.1 (built Sat, 01 Aug 2009 12:09:26 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) X-PTX-Original-Recipient: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 20 Mar 2010 14:18:00 +0000 (UTC) diff --git a/drivers/media/video/cs5345.c b/drivers/media/video/cs5345.c index 57dc170..cd21aa8 100644 --- a/drivers/media/video/cs5345.c +++ b/drivers/media/video/cs5345.c @@ -196,6 +196,7 @@ static int cs5345_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); v4l2_device_unregister_subdev(sd); + i2c_set_clientdata(client, NULL); kfree(sd); return 0; } diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c index 80bca8d..527f731 100644 --- a/drivers/media/video/cs53l32a.c +++ b/drivers/media/video/cs53l32a.c @@ -199,6 +199,7 @@ static int cs53l32a_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); v4l2_device_unregister_subdev(sd); + i2c_set_clientdata(client, NULL); kfree(sd); return 0; } diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index da18d69..f29c5cd 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c @@ -461,6 +461,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) return 0; err_out_free: + i2c_set_clientdata(client, NULL); kfree(ir); return err; } @@ -476,6 +477,7 @@ static int ir_remove(struct i2c_client *client) ir_input_unregister(ir->input); /* free memory */ + i2c_set_clientdata(client, NULL); kfree(ir); return 0; } diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c index d381fce..b608aaf 100644 --- a/drivers/media/video/tda9840.c +++ b/drivers/media/video/tda9840.c @@ -188,6 +188,7 @@ static int tda9840_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); v4l2_device_unregister_subdev(sd); + i2c_set_clientdata(client, NULL); kfree(sd); return 0; } diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c index 1585839..49a6606 100644 --- a/drivers/media/video/tea6415c.c +++ b/drivers/media/video/tea6415c.c @@ -164,6 +164,7 @@ static int tea6415c_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); v4l2_device_unregister_subdev(sd); + i2c_set_clientdata(client, NULL); kfree(sd); return 0; } diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c index 6bf6bc7..821085d 100644 --- a/drivers/media/video/tea6420.c +++ b/drivers/media/video/tea6420.c @@ -146,6 +146,7 @@ static int tea6420_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); v4l2_device_unregister_subdev(sd); + i2c_set_clientdata(client, NULL); kfree(sd); return 0; } diff --git a/drivers/media/video/ths7303.c b/drivers/media/video/ths7303.c index 21781f8..d411a73 100644 --- a/drivers/media/video/ths7303.c +++ b/drivers/media/video/ths7303.c @@ -114,6 +114,7 @@ static int ths7303_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); v4l2_device_unregister_subdev(sd); + i2c_set_clientdata(client, NULL); kfree(sd); return 0;