[PATCH 0/3] staging: ks7010: clean function calls

Tobin C. Harding me at tobin.cc
Tue Mar 28 06:11:06 UTC 2017


Driver file ks7010_sdio.c contains a few function definition
anomalies. One function is defined with two parameters, one of which
is a struct member of the other. This is unnecessary.

A couple of functions with internal linkage take as input parameters
of type void *. All call sites then cast struct pointers to void * in
order to do the function call, void * must then be cast back to the
original struct pointer type. This casting both ways is unnecessary.

Patch 01 removes the unnecessary function parameter.

Patch 02 fixes the function parameter types so casting is not used.

Patch 03 fixes a buffer overflow, not a real bug since the containing
function has internal linkage. Fixing this prevents future failure.

Code is untested. Builds on x86_64 and PowerPC.

Tobin C. Harding (3):
  staging: ks7010: remove unnecessary function parameter
  staging: ks7010: remove void * cast
  staging: ks7010: fix buffer overflow vulnerability

 drivers/staging/ks7010/ks7010_sdio.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

-- 
2.7.4



More information about the devel mailing list