linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/2] input/tps6507x-ts: dereferencing before checking
@ 2010-05-31 12:01 Dan Carpenter
  2010-05-31 19:17 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-05-31 12:01 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Todd Fischer, Samuel Ortiz, linux-input, kernel-janitors

This patch moves the dereference after the check for NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index 5de80a1..b99db09 100644
--- a/drivers/input/touchscreen/tps6507x-ts.c
+++ b/drivers/input/touchscreen/tps6507x-ts.c
@@ -355,10 +355,11 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev)
 {
 	struct tps6507x_dev *tps6507x_dev = platform_get_drvdata(pdev);
 	struct tps6507x_ts *tsc = tps6507x_dev->ts;
-	struct input_dev *input_dev = tsc->input_dev;
+	struct input_dev *input_dev;
 
 	if (!tsc)
 		return 0;
+	input_dev = tsc->input_dev;
 
 	cancel_delayed_work(&tsc->work);
 	flush_workqueue(tsc->wq);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-31 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-31 12:01 [patch 1/2] input/tps6507x-ts: dereferencing before checking Dan Carpenter
2010-05-31 19:17 ` Dmitry Torokhov
2010-05-31 20:40   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).