]> asedeno.scripts.mit.edu Git - linux.git/commit
ti-st: clean up data types (fix harmless memory corruption)
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 15 Jan 2015 11:42:27 +0000 (14:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Feb 2015 23:48:51 +0000 (15:48 -0800)
commit63e144c9d6ffa791c1402f4ee4551c1b9f5a336a
tree1d21080184560b6814080cb8d5e704a5ab6d4c6b
parent663b7ee9517eec6deea9a48c7a1392a9a34f7809
ti-st: clean up data types (fix harmless memory corruption)

The big issue here is:

of_property_read_u32(np, "flow_cntrl", (u32 *)&dt_pdata->flow_cntrl);

"->flow_cntrl" is a char so when we write a 32 bit number to it then it
corrupts past the end of the char.  It's probably hard to notice because
the struct has padding so the code works on little endian systems. But
on a big endian system the code would fail and on a 64 bit, big endian
systems then "nshutdown_gpio" and "baud_rate" would be buggy as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ti-st/st_kim.c
include/linux/ti_wilink_st.h