Skip to content

Commit

Permalink
dma-debug: debugfs_create_bool() takes a u32 pointer
Browse files Browse the repository at this point in the history
Even though it has "bool" in the name, you have pass a u32 pointer to
debugfs_create_bool().  Otherwise you get memory corruption in
write_file_bool().  Fortunately in this case the corruption happens in
an alignment hole between variables so it doesn't cause any problems.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
  • Loading branch information
Dan Carpenter authored and Joerg Roedel committed Jul 2, 2012
1 parent 8f53dc7 commit 68ee6d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/dma-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static LIST_HEAD(free_entries);
static DEFINE_SPINLOCK(free_entries_lock);

/* Global disable flag - will be set in case of an error */
static bool global_disable __read_mostly;
static u32 global_disable __read_mostly;

/* Global error count */
static u32 error_count;
Expand Down Expand Up @@ -657,7 +657,7 @@ static int dma_debug_fs_init(void)

global_disable_dent = debugfs_create_bool("disabled", 0444,
dma_debug_dent,
(u32 *)&global_disable);
&global_disable);
if (!global_disable_dent)
goto out_err;

Expand Down

0 comments on commit 68ee6d2

Please sign in to comment.