From: H Hartley Sweeten Date: Thu, 20 Sep 2012 00:26:53 +0000 (-0700) Subject: staging: comedi: kcomedilib: fix a __user space access issue X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~75^2~59 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f5cc359158772304a92ee9c5682ca83416d2ba8;p=pandora-kernel.git staging: comedi: kcomedilib: fix a __user space access issue The 'data' field in struct comedi_insn is an unsigned int __user *. The comedi core copies this data to kernel space before passing it on to a drivers insn_bits/insn_config method. kcomedilib provides an interface for external kernel modules to use the comedi drivers. This interface creates a comedi_insn that is then passed to the comedi drivers insn_bits/insn_config method. Unfortunately, kcomedilib is using the comedi_insn 'data' field directly which results in some sparse warnings: warning: incorrect type in argument 4 (different address spaces) expected unsigned int * got unsigned int [noderef] *data warning: incorrect type in assignment (different address spaces) expected unsigned int [noderef] *[addressable] [assigned] data got unsigned int * Fix this by passing the kernel data directly, as a separate parameter, instead of trying to put in into the comedi_insn 'data' field. This is how the comedi core handles the data from user space. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed