[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1421475161-17755-1-git-send-email-shailendra.capricorn@gmail.com>
Date: Sat, 17 Jan 2015 11:42:41 +0530
From: Shailendra Verma <shailendra.capricorn@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
John Stultz <john.stultz@...aro.org>,
Mitchel Humpherys <mitchelh@...eaurora.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org,
Shailendra Verma <shailendra.capricorn@...il.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.
Signed-off-by: Shailendra Verma <shailendra.capricorn@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists