Commit Graph

323960 Commits

Author SHA1 Message Date
Alexey Khoroshilov 4c229df0b1 staging: sbe-2t3e3: fix error handling in t3e3_init_channel()
t3e3_init_channel() incorrectly handles errors in several places:
it returns zero and does not deallocate all required resources.
The patch fixes that places.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-25 15:48:25 -07:00
Ian Abbott 62fea8c8f1 staging: comedi: ni_labpc: don't pass struct comedi_cmd by value
`labpc_suggest_transfer_size()` has a parameter of type `struct
comedi_cmd` passed by value.  Change it to pass by pointer reference.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:29:54 -07:00
Ian Abbott eb4332eff5 staging: comedi: das1800: don't pass struct comedi_cmd by value
Various functions in das1800.c take a `struct comedi_cmd` parameter by
value.  Change them to pass the parameter by reference instead.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:29:54 -07:00
Ian Abbott 44b255f7b1 staging: comedi: das16: pass struct comedi_cmd by reference
Change `das16_suggest_transfer_size()` to take a pointer to the `struct
comedi_cmd` instead of passing it by value.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:29:54 -07:00
Ian Abbott c8cad4c89e staging: comedi: fix memory leak for saved channel list
When `do_cmd_ioctl()` allocates memory for the kernel copy of a channel
list, it frees any previously allocated channel list in
`async->cmd.chanlist` and replaces it with the new one.  However, if the
device is ever removed (or "detached") the cleanup code in
`cleanup_device()` in "drivers.c" does not free this memory so it is
lost.

A sensible place to free the kernel copy of the channel list is in
`do_become_nonbusy()` as at that point the comedi asynchronous command
associated with the channel list is no longer valid.  Free the channel
list in `do_become_nonbusy()` instead of `do_cmd_ioctl()` and clear the
pointer to prevent it being freed more than once.

Note that `cleanup_device()` could be called at an inappropriate time
while the comedi device is open, but that's a separate bug not related
to this this patch.

Cc: stable@vger.kernel.org
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:29:53 -07:00
Ian Abbott 6f73fbcec2 staging: comedi: ni_labpc: pass ai scan mode through various functions
Pass the `enum scan_mode` value calculated by `labpc_ai_scan_mode()` as
a parameter to various other functions so they don't have to call it
themselves.  Amongst others, the affected functions include
`labpc_adc_timing()`, `labpc_ai_convert_period()` and
`labpc_ai_scan_period()`.

`labpc_adc_timing()` calls `labpc_ai_convert_period()` and
`labpc_ai_scan_period()` in several places, but the returned values are
the same each time, so change it to just call those functions once and
re-use the return values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:29:53 -07:00
H Hartley Sweeten 5743aaac29 staging: comedi: 8253: mmio address is a void __iomem *
The inline functions for accessing a memory mapped 8254 device
are using a void * for the 'base_address' of the device. Memory
mapped io using the read/write functions should be using a
void __iomem * for the address.

Fixing these exposed a couple other void * / void __iomem *
issues in the ni_labpc driver.

This fixes a number of sparse warnings like:

  warning: incorrect type in argument 2 (different address spaces)
     expected void volatile [noderef] <asn:2>*addr
     got void *

  warning: incorrect type in argument 1 (different address spaces)
     expected void const volatile [noderef] <asn:2>*addr
     got void *<noident>

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:26:20 -07:00
H Hartley Sweeten 1f5cc35915 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 *<noident>
     got unsigned int [noderef] <asn:1>*data

  warning: incorrect type in assignment (different address spaces)
     expected unsigned int [noderef] <asn:1>*[addressable] [assigned] data
     got unsigned int *<noident>

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 <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:26:20 -07:00
H Hartley Sweeten 94174847ea staging: comedi: me_daq: use attach_pci callback
Convert this PCI driver to use the comedi PCI auto config attach
mechanism by adding an 'attach_pci' callback function. Since the
driver does not require any external configuration options. and
the legacy 'attach' callback is now optional, remove it.

Also, make the boardinfo 'name' unique for the different board types.
Use this name when requesting the PCI resources. Change the printk
at the end of the attach into a dev_info.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:24:17 -07:00
H Hartley Sweeten 1e12ca3407 staging: comedi: me_daq: use request_firmware()
This driver requires loading a firmware file for the fpga. This
is currently being done by passing the firmware data using the
COMEDI_DEVCONFIG ioctl through the attach() hook in the driver.
This does not work for auto-configured PCI devices due to the
firmware loading options not being set in the comedi_devconfig
parameter passed to the driver.

Change the driver so it gets the firmware using request_firmware()
and ignore any firmware options passed in the comedi_devconfig.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:24:16 -07:00
H Hartley Sweeten 5a0f226089 staging: comedi: usbdux: remove usbdux_attach
This driver originally used the 'attach' method in order to get
the firmware for the device from the comedi_config utility. It
now uses request_firmware_nowait() in the usb_driver probe to
get this firmware.

Since this driver has an 'attach_usb' method in the comedi_driver,
the 'attach' method can be removed because it is now optional.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:24:16 -07:00
H Hartley Sweeten 4e5ba2f6bd staging: comedi: usbduxfast: remove usbduxfast_attach
This driver originally used the 'attach' method in order to get
the firmware for the device from the comedi_config utility. It
now uses request_firmware_nowait() in the usb_driver probe to
get this firmware.

Since this driver has an 'attach_usb' method in the comedi_driver,
the 'attach' method can be removed because it is now optional.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:24:16 -07:00
H Hartley Sweeten 453443f32f staging: comedi: usbduxsigma: remove usbduxsigma_attach
This driver originally used the 'attach' method in order to get
the firmware for the device from the comedi_config utility. It
now uses request_firmware_nowait() in the usb_driver probe to
get this firmware.

Since this driver has an 'attach_usb' method in the comedi_driver,
the 'attach' method can be removed because it is now optional.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:24:16 -07:00
H Hartley Sweeten bda60cbfe2 staging: comedi: s526: rename s526_ai_config
For aesthetic reasons, rename the private data variable
's526_ai_config' to simply 'ai_config'. Its private data
and does not need the 's526_' namespace.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:45 -07:00
H Hartley Sweeten 675f98f101 staging: comedi: s526: remove struct s526GPCTConfig
The enum in this struct is used by the driver to know how the
gpct channels have been configured. Instead of using the private
enum S526_GPCT_APP_CLASS, we can just use the INSN_CONFIG_* value
that was passed in data[0] to the s526_gpct_insn_config().

The data array in this struct in never used. It actually could
cause a BUG since it assumes that the data pointer passed to
s526_gpct_insn_config() always has 6 values but the comments
indicate that there are really only 4 or 5.

Remove the s526GPCTConfig struct and associated S526_GPCT_APP_CLASS
enum and just use and unsigned int array in the private data to
hold the gpct configuration.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:44 -07:00
H Hartley Sweeten 5c813bb100 staging: comedi: s526: cleanup s526_gpct_winsn()
Use a local variable for the iobase of the channel being written.
This makes the outw() calls a bit cleaner.

Rearrange the switch () so that the actual write to the device
can be common regardless of the gpct configuration.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:44 -07:00
H Hartley Sweeten 5a5614cb66 staging: comedi: s526: cleanup s526_gpct_insn_config()
Use a local variable for the iobase of the channel being configured.
This makes the outw() calls a bit cleaner.

Remove the unnecessary casting of the values being written to
the channel registers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:44 -07:00
H Hartley Sweeten 2a29edf698 staging: comedi: s526: cleanup s526_gpct_rinsn()
Use a local variable for the iobase of the channel being read.
This makes the inw() calls a bit cleaner.

Move the masking of the read data to make the value stored in
the data array a bit clearer.

The comedi core expects insn_read functions to return the number
of insn data values read. For this function, the final value of
'i' is correct but change the return to 'insn->n' just to make
it clear.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:44 -07:00
H Hartley Sweeten 43a352760e staging: comedi: s526: rename local var used for CR_CHAN() value
Rename the local variable used to hold the unpacked CR_CHAN() value
to help keep the lines < 80 chars.

Also, since the insn->chanspec variable is an unsigned int, change
the type of the local variable to match.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:44 -07:00
H Hartley Sweeten 3d9083b27a staging: comedi: s526: remove boardinfo
This driver only supports one board type and only the "name",
"gpct_chans", and "have_dio" information is being used anyway.

Just remove the boardinfo to keep the driver simple.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:43 -07:00
H Hartley Sweeten 2c7817891d staging: comedi: s526: remove cut-and-paste comments from skel driver
These comments are not necessary, they are just cut-and-paste from
the skel driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:43 -07:00
H Hartley Sweeten 2a117a92ef staging: comedi: s526: remove unused s526_ports array
This array was used to debug dump the registers. The debug
dump has been removed so this array is no longer needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:43 -07:00
H Hartley Sweeten d160895fe8 staging: comedi: s526: remove printk noise
Remove the function trace printk noise.

Change the final attach message into a simple dev_info.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:43 -07:00
H Hartley Sweeten 28eb7e8d76 staging: comedi: s526: remove unreachable code in s526_attach()
The code after the return in this function can never execute.
Just remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:42 -07:00
H Hartley Sweeten d52f042ce5 staging: comedi: s526: remove unneeded check in s526_gpct_rinsn()
The comedi core validates insn->n before calling this function.
Remove the unnecessary check.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:42 -07:00
H Hartley Sweeten 898143bd1a staging: comedi: s526: remove commented out debug messages
These messages should be removed from the final driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:42 -07:00
H Hartley Sweeten 36fe5d265d staging: comedi: s526: remove ADDR_CHAN_REG macro
This macro relies on a local variable having a specific name.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:42 -07:00
H Hartley Sweeten 0171e6f5bb staging: comedi: s526: remove ADDR_REG macro
This macro relies on a local variable having a specific name.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:42 -07:00
H Hartley Sweeten 5f2210627f staging: comedi: s526: remove devpriv macro
This macro relies on a local variable having a specific name.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:41 -07:00
H Hartley Sweeten b2abd982c4 staging: comedi: s526: don't dereference insn->data pointer
The comedi_insn 'data' pointer is a __user pointer that is
passed into the kernel using an ioctl. The comedi core copies
this data to kernel space in do_insnlist_ioctl() and then
passes that kernel data to the drivers as a separate parameter.
The drivers never need to access the data through the insn->data
pointer.

This fixes a number of sparse warnings about:

  warning: dereference of noderef expression

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:19:41 -07:00
Sascha Hauer effef787a9 staging: drm/imx: Add TODO
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:17:07 -07:00
Philipp Zabel 2d62da8ebd staging: drm/imx: Add devicetree binding documentation
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:17:06 -07:00
Sascha Hauer f326f7995b staging: drm/imx: Add i.MX IPUv3 crtc support
This adds a i.MX51/53/6 IPU (Image Processing Unit) KMS driver. The
driver has been tested on the i.MX51 babbage board, the i.MX53 LOCO
board and the i.MX6q sabrelite board in different clone mode and dual
head setups.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:17:06 -07:00
Sascha Hauer aecfbdb180 staging: drm/imx: add i.MX IPUv3 base driver
The IPU is the Image Processing Unit found on i.MX51/53/6 SoCs. It
features several units for image processing, this patch adds support
for the units needed for Framebuffer support, namely:

- Display Controller (dc)
- Display Interface (di)
- Display Multi Fifo Controller (dmfc)
- Display Processor (dp)
- Image DMA Controller (idmac)

This patch is based on the Freescale driver, but follows a different
approach. The Freescale code implements logical idmac channels and
the handling of the subunits is hidden in common idmac code pathes
in big switch/case statements. This patch instead just provides code
and resource management for the different subunits. The user, in this
case the framebuffer driver, decides how the different units play
together.

The IPU has other units missing in this patch:

- CMOS Sensor Interface (csi)
- Video Deinterlacer (vdi)
- Sensor Multi FIFO Controler (smfc)
- Image Converter (ic)
- Image Rotator (irt)

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:17:06 -07:00
Sascha Hauer 19022aaae6 staging: drm/imx: Add parallel display support
This adds support for parallel displays for i.MX. It consists
of a drm encoder/connector pair which eventually passes EDID
data from the devicetree to the drm core.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:17:06 -07:00
Sascha Hauer e692da4d0e staging: drm/imx: Add i.MX drm core support
This patch adds the i.MX glue stuff between i.MX and drm.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:15:00 -07:00
Kevin McKinney f34170c762 Staging: bcm: Remove typedef for _stIM_sfHostNotify and call directly.
This patch removes typedef for _stIM_sfHostNotify,
changes the name of the struct from
_stIM_sfHostNotify to bcm_stim_sfhostnotify.
In addition, any calls to the following typedef
"stIM_sfHostNotify" are changed to call the
struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:13:14 -07:00
Wei Yongjun b0ba76785e staging: tidspbridge: fix return value check in dsp_wdt_init()
In case of error, the function clk_get() returns ERR_PTR()
and never returns NULL pointer. The NULL test in the error
handling should be replaced with IS_ERR().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 09:02:23 -07:00
Devendra Naga a00979cccb staging: sbe-2t3e3: use -ve error return codes in dc_init_descriptor_list
the dc_init_descriptor_list actually returns a +ve error return codes,
which is abnormal as other functions in kernel return -ve error codes on
failure. so replace the return codes of this function with -ve values
to make the consistency with the other functions in kernel.

Also make the dc_init_descriptor_list static as its never called
anywhere except in this file and move the function prototype from the
headerfile into the c file as its referred only in this c file.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:57:56 -07:00
Devendra Naga bae95b0907 staging:ced1401: remove read write callbacks from fops
As the driver says that read and writes should not be performed
and instead the user to kernel transactions are performed through
ioctl interface, remove these functions as they are not required

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:41 -07:00
Devendra Naga 2341111f6d staging:ced1401: use module_usb_driver macro
the module init and exit functions that are
doing usb_register and usb_deregister respectively can be
replaced with module_usb_driver code

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:41 -07:00
YAMANE Toshiaki 814394100d staging/rts_pstor: Delete some lines (dev_info() and dev_err()) in rtsx.c
fixed some coccinelle warnings.
+ drivers/staging/rts_pstor/rtsx.c:397:16-19: ERROR: dev is NULL but dereferenced.
  drivers/staging/rts_pstor/rtsx.c:447:16-19: ERROR: dev is NULL but dereferenced.
  drivers/staging/rts_pstor/rtsx.c:358:16-19: ERROR: dev is NULL but dereferenced.

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:41 -07:00
Dan Carpenter 428ed14f36 Staging: ced1401: fix a couple off by one checks
nArea is used as an offset into the ->rTransDef[] array which has
MAX_TRANSAREAS elements.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:41 -07:00
Adam Buchbinder bff6c3e00c staging: Fix spelling of "asynchronous" in comments.
"Asychronous" is misspelled in some comments. No code changes.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:41 -07:00
Adam Buchbinder f2635894e8 staging: Fix misspellings of "whether".
"Whether" is spelled "wether" in several places. This fixes those that
are in the staging tree.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:40 -07:00
Randy Dunlap 8fb0aebddf staging: fix silicom dependencies and build errors
Fix kconfig dependencies in silicom.  Fixes these build errors:

ERROR: "init_net" [drivers/staging/silicom/bypasslib/bypass.ko] undefined!
ERROR: "register_netdevice_notifier" [drivers/staging/silicom/bpctl_mod.ko] undefined!
ERROR: "unregister_netdevice_notifier" [drivers/staging/silicom/bpctl_mod.ko] undefined!
ERROR: "init_net" [drivers/staging/silicom/bpctl_mod.ko] undefined!
ERROR: "netdev_info" [drivers/net/mii.ko] undefined!
ERROR: "netif_carrier_on" [drivers/net/mii.ko] undefined!
ERROR: "netif_carrier_off" [drivers/net/mii.ko] undefined!

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:40 -07:00
Radhesh Fadnis 463bf503bd staging: omap-thermal: bandgap: fix setting of alert thresholds
There was an error in check for the valid temperature in
function temp_to_adc_conversion. The temperature value was
compared with higher limit for less than condition as well,
resulting in returning -EINVAL. Corrected the check condition
to properly check for lower and higher temperature limits.

Signed-off-by: Radhesh Fadnis <radhesh.fadnis@ti.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:40 -07:00
navin cbf7d122cc staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd
In response to "usbip detach -p [port_number]" user command,vhci_shutdown_connection() gets
executed which kills tcp_tx,tcp_rx kernel threads but doesn't set thread pointers to NULL.
so, at the time of vhci_hcd removal vhci_shutdown_connection() again tries to kill kernel
threads which are already killed.

[  312.220259] BUG: unable to handle kernel NULL pointer dereference at           (null)
[  312.220313] IP: [<ffffffff8108186f>] exit_creds+0x1f/0x70
[  312.220349] PGD 5b7be067 PUD 5b7dc067 PMD 0
[  312.220388] Oops: 0000 [#1] SMP
[  312.220415] Modules linked in: vhci_hcd(O-) usbip_host(O) usbip_core(O) uas usb_storage joydev parport_pc bnep rfcomm ppdev binfmt_misc
snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq_midi arc4 snd_rawmidi snd_seq_midi_event snd_seq
ath9k mac80211 ath9k_common ath9k_hw snd_timer snd_seq_device snd ath i915 drm_kms_helper drm psmouse cfg80211 coretemp soundcore lpc_ich i2c_algo_bit
snd_page_alloc video intel_ips wmi btusb mac_hid bluetooth ideapad_laptop lp sparse_keymap serio_raw mei microcode parport r8169
[  312.220862] CPU 0
[  312.220882] Pid: 2095, comm: usbip_eh Tainted: G           O 3.6.0-rc3+ #2 LENOVO 20042                           /Base Board Product Name
[  312.220938] RIP: 0010:[<ffffffff8108186f>]  [<ffffffff8108186f>] exit_creds+0x1f/0x70
[  312.220979] RSP: 0018:ffff88004d6ebdb0  EFLAGS: 00010282
[  312.221008] RAX: 0000000000000000 RBX: ffff880041c4db40 RCX: ffff88005ad52230
[  312.221041] RDX: 0000000000000034 RSI: 0000000000000286 RDI: 0000000000000000
[  312.221074] RBP: ffff88004d6ebdc0 R08: ffff88004d6ea000 R09: 0000000000000000
[  312.221107] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
[  312.221144] R13: 0000000000000000 R14: ffff88005ad521d8 R15: ffff88004d6ebea0
[  312.221177] FS:  0000000000000000(0000) GS:ffff880077400000(0000) knlGS:0000000000000000
[  312.221214] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[  312.221241] CR2: 0000000000000000 CR3: 000000005b7b9000 CR4: 00000000000007f0
[  312.221277] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  312.221309] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  312.221342] Process usbip_eh (pid: 2095, threadinfo ffff88004d6ea000, task ffff88004d44db40)
[  312.221384] Stack:
[  312.221396]  ffff88004d6ebdc0 ffff880041c4db40 ffff88004d6ebde0 ffffffff81052aaa
[  312.221442]  ffff880041c4db40 0000000000000000 ffff88004d6ebe10 ffffffff8107a148
[  312.221487]  ffff88005ad521f0 ffff88005ad52228 ffff88004d44db40 ffff88005ad521d8
[  312.221536] Call Trace:
[  312.221556]  [<ffffffff81052aaa>] __put_task_struct+0x4a/0x140
[  312.221587]  [<ffffffff8107a148>] kthread_stop+0x108/0x110
[  312.221616]  [<ffffffffa0412569>] vhci_shutdown_connection+0x49/0x2b4 [vhci_hcd]
[  312.221657]  [<ffffffffa0139920>] event_handler_loop+0x70/0x140 [usbip_core]
[  312.221692]  [<ffffffff8107ad30>] ? add_wait_queue+0x60/0x60
[  312.221721]  [<ffffffffa01398b0>] ? usbip_stop_eh+0x30/0x30 [usbip_core]
[  312.221754]  [<ffffffff8107a453>] kthread+0x93/0xa0
[  312.221784]  [<ffffffff81670e84>] kernel_thread_helper+0x4/0x10
[  312.221814]  [<ffffffff8107a3c0>] ? flush_kthread_worker+0xb0/0xb0
[  312.223589]  [<ffffffff81670e80>] ? gs_change+0x13/0x13
[  312.225360] Code: 0b 0f 0b 66 0f 1f 84 00 00 00 00 00 55 48 89 e5 53 48 83 ec 08 66 66 66 66 90 48 8b 87 58 04 00 00 48 89 fb 48 8b bf 50 04 00 00
<8b> 00 48 c7 83 50 04 00 00 00 00 00 00 f0 ff 0f 0f 94 c0 84 c0
[  312.229663] RIP  [<ffffffff8108186f>] exit_creds+0x1f/0x70
[  312.231696]  RSP <ffff88004d6ebdb0>
[  312.233648] CR2: 0000000000000000
[  312.256464] ---[ end trace 1971ce612a167279 ]---

Signed-off-by: navin patidar <navinp@cdac.in>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:40 -07:00
navin b7caecb8c9 staging: usbip: stub_dev: Fixed oops during removal of usbip_host
stub_shutdown_connection() should set kernel thread pointers to NULL after killing them.
so that at the time of usbip_host removal stub_shutdown_connection() doesn't try to kill kernel threads
which are already killed.

[ 1504.312158] BUG: unable to handle kernel NULL pointer dereference at           (null)
[ 1504.315833] IP: [<ffffffff8108186f>] exit_creds+0x1f/0x70
[ 1504.317688] PGD 41f1c067 PUD 41d0f067 PMD 0
[ 1504.319611] Oops: 0000 [#2] SMP
[ 1504.321480] Modules linked in: vhci_hcd(O) usbip_host(O-) usbip_core(O) uas usb_storage joydev parport_pc bnep rfcomm ppdev binfmt_misc
snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq_midi arc4 snd_rawmidi snd_seq_midi_event
snd_seq ath9k mac80211 ath9k_common ath9k_hw snd_timer snd_seq_device snd ath i915 drm_kms_helper drm psmouse cfg80211 coretemp soundcore
lpc_ich i2c_algo_bit snd_page_alloc video intel_ips wmi btusb mac_hid bluetooth ideapad_laptop lp sparse_keymap serio_raw mei microcode parport r8169
[ 1504.329666] CPU 1
[ 1504.329687] Pid: 2434, comm: usbip_eh Tainted: G      D    O 3.6.0-rc31+ #2 LENOVO 20042                           /Base Board Product Name
[ 1504.333502] RIP: 0010:[<ffffffff8108186f>]  [<ffffffff8108186f>] exit_creds+0x1f/0x70
[ 1504.335371] RSP: 0018:ffff880041c7fdd0  EFLAGS: 00010282
[ 1504.337226] RAX: 0000000000000000 RBX: ffff880041c2db40 RCX: ffff880041e4ae50
[ 1504.339101] RDX: 0000000000000044 RSI: 0000000000000286 RDI: 0000000000000000
[ 1504.341027] RBP: ffff880041c7fde0 R08: ffff880041c7e000 R09: 0000000000000000
[ 1504.342934] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
[ 1504.344840] R13: 0000000000000000 R14: ffff88004d448000 R15: ffff880041c7fea0
[ 1504.346743] FS:  0000000000000000(0000) GS:ffff880077440000(0000) knlGS:0000000000000000
[ 1504.348671] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 1504.350612] CR2: 0000000000000000 CR3: 0000000041d0d000 CR4: 00000000000007e0
[ 1504.352723] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1504.354734] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1504.356737] Process usbip_eh (pid: 2434, threadinfo ffff880041c7e000, task ffff88004d448000)
[ 1504.358711] Stack:
[ 1504.360635]  ffff880041c7fde0 ffff880041c2db40 ffff880041c7fe00 ffffffff81052aaa
[ 1504.362589]  ffff880041c2db40 0000000000000000 ffff880041c7fe30 ffffffff8107a148
[ 1504.364539]  ffff880041e4ae10 ffff880041e4ae00 ffff88004d448000 ffff88004d448000
[ 1504.366470] Call Trace:
[ 1504.368368]  [<ffffffff81052aaa>] __put_task_struct+0x4a/0x140
[ 1504.370307]  [<ffffffff8107a148>] kthread_stop+0x108/0x110
[ 1504.370312]  [<ffffffffa040da4e>] stub_shutdown_connection+0x3e/0x1b0 [usbip_host]
[ 1504.370315]  [<ffffffffa03fd920>] event_handler_loop+0x70/0x140 [usbip_core]
[ 1504.370318]  [<ffffffff8107ad30>] ? add_wait_queue+0x60/0x60
[ 1504.370320]  [<ffffffffa03fd8b0>] ? usbip_stop_eh+0x30/0x30 [usbip_core]
[ 1504.370322]  [<ffffffff8107a453>] kthread+0x93/0xa0
[ 1504.370327]  [<ffffffff81670e84>] kernel_thread_helper+0x4/0x10
[ 1504.370330]  [<ffffffff8107a3c0>] ? flush_kthread_worker+0xb0/0xb0
[ 1504.370332]  [<ffffffff81670e80>] ? gs_change+0x13/0x13
[ 1504.370351] Code: 0b 0f 0b 66 0f 1f 84 00 00 00 00 00 55 48 89 e5 53 48 83 ec 08 66 66 66 66 90 48 8b 87 58 04 00 00 48 89 fb 48 8b bf 50 04 00 00
<8b> 00 48 c7 83 50 04 00 00 00 00 00 00 f0 ff 0f 0f 94 c0 84 c0
[ 1504.370353] RIP  [<ffffffff8108186f>] exit_creds+0x1f/0x70
[ 1504.370353]  RSP <ffff880041c7fdd0>
[ 1504.370354] CR2: 0000000000000000
[ 1504.401376] ---[ end trace 1971ce612a16727a ]---

Signed-off-by: navin patidar <navinp@cdac.in>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:39 -07:00
Ian Abbott 5d06e3df28 staging: comedi: don't dereference user memory for INSN_INTTRIG
`parse_insn()` is dereferencing the user-space pointer `insn->data`
directly when handling the `INSN_INTTRIG` comedi instruction.  It
shouldn't be using `insn->data` at all; it should be using the separate
`data` pointer passed to the function.  Fix it.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-19 11:26:13 +01:00