kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] Staging: cptm1217: move free under dereference
@ 2010-11-13  8:34 Dan Carpenter
  2010-11-16 13:38 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-11-13  8:34 UTC (permalink / raw)
  To: kernel-janitors

We dereference "ts" in the printk so move the kfree() down a line.

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

diff --git a/drivers/staging/cptm1217/clearpad_tm1217.c b/drivers/staging/cptm1217/clearpad_tm1217.c
index 269503f..76e4b78 100644
--- a/drivers/staging/cptm1217/clearpad_tm1217.c
+++ b/drivers/staging/cptm1217/clearpad_tm1217.c
@@ -460,9 +460,9 @@ static int cp_tm1217_probe(struct i2c_client *client,
 	for (i = 0; i < TOUCH_SUPPORTED; i++) {
 		input_dev = input_allocate_device();
 		if (input_dev = NULL) {
-			kfree(ts);
 			dev_err(ts->dev,
 				"cp_tm1217:Input Device Struct alloc failed\n");
+			kfree(ts);
 			return -ENOMEM;
 		}
 		input_info = &ts->cp_input_info[i];

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

* Re: [patch] Staging: cptm1217: move free under dereference
  2010-11-13  8:34 [patch] Staging: cptm1217: move free under dereference Dan Carpenter
@ 2010-11-16 13:38 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2010-11-16 13:38 UTC (permalink / raw)
  To: kernel-janitors

On Sat, 13 Nov 2010 11:34:16 +0300
Dan Carpenter <error27@gmail.com> wrote:

> We dereference "ts" in the printk so move the kfree() down a line.

Acked-by: Alan Cox <alan@linux.intel.com>

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

end of thread, other threads:[~2010-11-16 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-13  8:34 [patch] Staging: cptm1217: move free under dereference Dan Carpenter
2010-11-16 13:38 ` Alan Cox

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).