From: Shailendra Verma <shailendra.capricorn@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
John Stultz <john.stultz@linaro.org>,
Mitchel Humpherys <mitchelh@codeaurora.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org,
Shailendra Verma <shailendra.capricorn@gmail.com>
Subject: [PATCH 1/1] Fix Kernel Panic due to dereference of the invalid handle. First validate the handle and then derefer it in BUG_ON.
Date: Sat, 17 Jan 2015 11:42:41 +0530 [thread overview]
Message-ID: <1421475161-17755-1-git-send-email-shailendra.capricorn@gmail.com> (raw)
Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
---
drivers/staging/android/ion/ion.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 296d347..9e56d32 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -536,8 +536,6 @@ void ion_free(struct ion_client *client, struct ion_handle *handle)
{
bool valid_handle;
- BUG_ON(client != handle->client);
-
mutex_lock(&client->lock);
valid_handle = ion_handle_validate(client, handle);
@@ -547,6 +545,7 @@ void ion_free(struct ion_client *client, struct ion_handle *handle)
return;
}
mutex_unlock(&client->lock);
+ BUG_ON(client != handle->client);
ion_handle_put(handle);
}
EXPORT_SYMBOL(ion_free);
--
1.7.9.5
next reply other threads:[~2015-01-17 6:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-17 6:12 Shailendra Verma [this message]
2015-01-17 14:05 ` Greg Kroah-Hartman
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=1421475161-17755-1-git-send-email-shailendra.capricorn@gmail.com \
--to=shailendra.capricorn@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mitchelh@codeaurora.org \
--cc=paulmck@linux.vnet.ibm.com \
/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
all inboxes | Powered by JetHome®