From 653bf0cfa55896b74d8cbe7e561401813ca359ad Mon Sep 17 00:00:00 2001 From: Mark Allyn Date: Thu, 9 Dec 2010 09:32:38 -0800 Subject: Staging: sep: ensure that caller id buffer is little endian Signed-off-by: Mark Allyn Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sep/sep_driver.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/staging/sep/sep_driver.c') diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c index 903d610..bb42b048 100644 --- a/drivers/staging/sep/sep_driver.c +++ b/drivers/staging/sep/sep_driver.c @@ -897,6 +897,7 @@ end_function: static int sep_set_current_caller_id(struct sep_device *sep) { int i; + u32 *hash_buf_ptr; dev_dbg(&sep->pdev->dev, "sep_set_current_caller_id start\n"); dev_dbg(&sep->pdev->dev, "current process is %d\n", current->pid); @@ -915,6 +916,13 @@ static int sep_set_current_caller_id(struct sep_device *sep) break; } } + /* Ensure data is in little endian */ + hash_buf_ptr = (u32 *)sep->shared_addr + + SEP_CALLER_ID_OFFSET_BYTES; + + for (i = 0; i < SEP_CALLER_ID_HASH_SIZE_IN_WORDS; i++) + hash_buf_ptr[i] = cpu_to_le32(hash_buf_ptr[i]); + dev_dbg(&sep->pdev->dev, "sep_set_current_caller_id end\n"); return 0; } -- cgit v1.1