Peng Tao [Wed, 29 May 2013 13:40:56 +0000 (21:40 +0800)]
staging/lustre: fix LBUG and inode refcount bug
ldlm_proc_setup and ldlm_proc_cleanup should reset global
pde pointers otherwise remount may hit
LASSERT(ldlm_ns_proc_dir == NULL);
Also in libcfs_sock_ioctl, fput() includes itself sock_release.
So don't call sock_release twice otherwise kernel may oops
due to incorrect inode ref counting.
Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peng Tao [Wed, 29 May 2013 13:40:55 +0000 (21:40 +0800)]
staging/lustre: adapt proc_dir_entry change
In 3.10 merge window, proc_dir_entry is now private to proc. However,
Lustre lprocfs depends heavily on it and its now-gone read_proc_t and
write_proc_t members.
The patch largely changed the fact, and made lprocfs depend on none of
proc_dir_entry private members. All lprocfs callers are converted to
use the new seq_file scheme.
Also lprocfs_srch is removed so that we can drop lprocfs_lock. All callers
are changed to save created pde in proper place.
See https://jira.hpdd.intel.com/browse/LU-3319 for more details.
Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Wed, 29 May 2013 06:57:36 +0000 (09:57 +0300)]
Staging: rtl8192e: printing the wrong array
Smatch complained that there is an array overflow here. It looks
like we are supposed to be printing the ->rates_ex[] array which is
slightly larger than the ->rates[] array. This is a cut and paste
error.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wei Yongjun [Thu, 23 May 2013 09:28:05 +0000 (17:28 +0800)]
Staging: vt6655: add missing free_netdev() on error in hostap_enable_hostapd()
Add the missing free_netdev() before return from function
hostap_enable_hostapd() in the error handling case.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: usbduxsigma: tidy up analog input command support
Rename the (*do_cmdtest) and (*do_cmd) functions so they have namespace
associated with the driver. Rename the local variable used for the
private data pointer.
Move all the command argument initialization and testing into the
(*do_cmdtest) function. That function is always called by the comedi
core before the (*do_cmd) function. The only thing the (*do_cmd) function
should have to do is setup the channel list, send the command to start
the analog input sampling, initialize the counter for the conversion,
then either read the acquisition data (submit the urbs) or set the
trigger to read the data later.
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>
staging: comedi: usbduxsigma: cleanup the private data 'outBuffer'
This buffer is used to cache the analog output values that are written
to the analog output channels. Currently it only caches the single
writes to the channels using the (*insn_write) callback. The async
command writes are not cached. The buffer is also being kzalloc'ed
during the attach of the driver to a size much larger that required.
Rename the CamelCase buffer and change it to an array in the private
data of the correct size to cache the analog output channel values.
Modify the analog output urb callback so it updates the cached values
with those used for the asynchronous command to allow readback after
the command completes.
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>
staging: comedi: usbduxsigma: tidy up analog output command support
Rename the (*do_cmdtest) and (*do_cmd) functions so they have namespace
associated with the driver. Rename the local variable used for the
private data pointer.
Move all the command argument initialization and testing into the
(*do_cmdtest) function. That function is always called by the comedi
core before the (*do_cmd) function. The only thing the (*do_cmd) function
should have to do is setup the channel list, initialize the counter for
the conversion, then either start the conversion (submit the urbs) or
set the trigger to start the conversion.
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>
staging: comedi: usbduxsigma: tidy up usbdux_dio_insn_config()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Add a local variable for the channel mask.
Remove the unnecessary comments and clean up the multi-line comment
at the end.
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>
staging: comedi: usbduxsigma: tidy up usbdux_dio_insn_bits()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Remove the unnecessary casts.
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>
For aesthetics, move this function near its caller. Also, move the
FIRMWARE_MAX_LEN define so its with the other firmware constants
and fix the whitespace.
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>
Rename the function so it has namespace associated with the driver.
For aesthetic reasons, move the function so it's near the one that
allocates the usb buffers.
Tidy up the function so it frees the buffers in the opposite order
they were allocated. Also remove the = NULL for all the buffers,
the driver is being detached so the comedi core will kfree the
private data.
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>
staging: comedi: usbduxsigma: remove tidy_up() from (*auto_attach)
Comedi drivers do not need to cleanup allocations during the
(*auto_attach). If the (*auto_attach) fails the (*detach) will
automatically be called to handle the cleanup.
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>
staging: comedi: usbduxsigma: remove unnecessary check in usbdux_ao_cmd()
The comedi core verifies that the command chanlist_len is valid for
the subdevice based on the len_chanlist that was setup during the
attach. There is no need to recheck it in the (*cmd) function.
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>
staging: comedi: usbduxsigma: remove unnecessary check in usbdux_ai_cmd()
The comedi core verifies that the command chanlist_len is valid for
the subdevice based on the len_chanlist that was setup during the
attach. There is no need to recheck it in the (*cmd) function.
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>
staging: comedi: usbduxsigma: remove private data sanity checks
The comedi functions in this driver can only be called if the
(*auto_attach) successfull kzalloc'ed the private data and set
dev->private. The extra sanity checks are not needed. Remove them.
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>
staging: comedi: usbduxsigma: push usb (*probe) into comedi (*auto_attach)
The usb_driver (*probe) already calls comedi_usb_auto_config(), which
will call the comedi_driver (*auto_attach). Move the bulk of the (*probe)
to the (*auto_attach).
This allows the comedi_device private data to be kzalloc'ed and the static
array used to pass the private data from the usb_driver to the comedi_driver
can be removed along with the static semaphore that protected it.
We can also drop a couple variables from the private data since they no
longer are used or 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>
staging: comedi: usbduxsigma: push usb (*disconnect) into comedi (*detach)
The usb_driver (*disconnect) already calls comedi_usb_auto_unconfig(), which
will call the comedi_driver (*detach). Move the other operations in the
(*disconnect) into the (*detach). The comedi_usb_auto_unconfig() can then
be used directly for the (*disconnect).
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>
staging: comedi: usbduxsigma: factor usb buffer allocation out of (*probe)
To make pushing the usb_driver (*probe) into the comedi_driver (*auto_attach)
cleaner, factor the usb buffer allocation out of the (*probe). This also
cleans up the failure paths in the (*probe).
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>
staging: comedi: usbduxsigma: remove 'probed' checks in comedi functions
The 'probed' flag in the private data is used by the usb_driver (*probe)
function to find a free entry in the static usbduxsub array to use for
the comedi_device private data. The (*probe) sets this flag before it
hands off the probe to the comedi_driver (*auto_attach). The 'probed'
flag is cleared in tidy_up() are part of the usb_driver (*disconnect),
which calls the comedi_driver (*detach).
The 'probed' flag will always be set if the comedi_driver (*auto_attach)
completes successfully. The extra sanity checks in the comedi functions
are not needed. Remove them.
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>
staging: comedi: usbduxsigma: generalize the usb_submit_urb functions
Generalize a helper function to replace usbduxsub_submit_{In,Out}URBs().
In the callers, set the 'a[io]_cmd_running' flag after the urbs have been
successfully submitted. This removes the need to clear the flag if the
submit fails.
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>
staging: comedi: usbduxsigma: tidy up usbduxsub_ao_IsocIrq()
Rename the local variables to follow the "norm" for comedi drivers.
The comedi_subdevice for this function is the dev->write_subdev that
was initialized during the (*auto_attach), use that instead of
directly accessing the comedi_device subdevices array.
Use dev->class_dev for any dev_{level} messages.
Remove the extra check of 'ao_cmd_running' before submitting the urb.
This flag was previously checked and if the command is aborted due to
an usbdux_ao_stop() before reaching this point the function will exit.
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>
staging: comedi: usbduxsigma: tidy up usbduxsub_ai_IsocIrq()
Rename the local variables to follow the "norm" for comedi drivers.
The comedi_subdevice for this function is the dev->read_subdev that
was initialized during the (*auto_attach), use that instead of
directly accessing the comedi_device subdevices array.
Use dev->class_dev for any dev_{level} messages.
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>
staging: comedi: usbduxsigma: use usbdux_pwm_stop() to force unlink urb
In tidy_up(), instead of duplicating the code in usbdux_pwm_stop() to
unlink the pwm urb, just use usbdux_pwm_stop(). Since that function calls
usb_kill_urb() and clears the 'pwm_cmd_running' flag, we can also remove
the redundant code in tidy_up().
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>
staging: comedi: usbduxsigma: use usbdux_ao_stop() to force unlink all urbs
In tidy_up(), instead of duplicating the code in usbdux_ao_stop() to unlink
all the output urbs, just use usbdux_ao_stop(). Since that function calls
usb_kill_urb() for all the urbs and clears the 'ao_cmd_running' flag, we
can also remove the redundant code in tidy_up().
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>
staging: comedi: usbduxsigma: use usbdux_ai_stop() to force unlink all urbs
In tidy_up(), instead of duplicating the code in usbdux_ai_stop() to unlink
all the input urbs, just use usbdux_ai_stop(). Since that function calls
usb_kill_urb() for all the urbs and clears the 'ai_cmd_running' flag, we
can also remove the redundant code in tidy_up().
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>
staging: comedi: usbduxsigma: cleanup the (*cancel) functions
The (*cancel) functions can only be called by the comedi core it the
(*auto_attach) completed successfully. That function sets the comedi_device
'private' variable before initializing the callbacks so the sanity checks
are unnecessary. Remove them.
Also, rename the 'this_usbduxsub' local variable to 'devpriv' as this is
more common in comedi drivers.
Remove the unnecessary comments.
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>
staging: comedi: usbduxsigma: remove check of 'probed' in (*cancel) functions
The comedi_device private data variable 'probed' is set after the usb_driver
has completed its (*probe) before calling comedi_usb_auto_config(). That
function calls the comedi_driver (*auto_attach) which will set the
comedi_device 'private' variable and initialize the subdevices.
The subdevice (*cancel) functions can only be called after the (*auto_attach)
has completed successfully so the sanity checks of 'probed' are unnecessary.
Remove them.
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>
staging: comedi: usbduxsigma: change return type of the stop functions
The usbdux_pwm_cancel() function is the only caller that does not validate
the comedi_device private data before calling the stop function. Move the
validation test to that function and remove the unnecessary sanity checks.
Since the stop functions always succeed, change the return type to void.
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>