From: Dan Carpenter <error27@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch] Staging: cptm1217: move free under dereference
Date: Sat, 13 Nov 2010 08:34:16 +0000 [thread overview]
Message-ID: <20101113083416.GL3533@bicker> (raw)
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];
next reply other threads:[~2010-11-13 8:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-13 8:34 Dan Carpenter [this message]
2010-11-16 13:38 ` [patch] Staging: cptm1217: move free under dereference Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101113083416.GL3533@bicker \
--to=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox