aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/usbip/vhci_sysfs.c
AgeCommit message (Collapse)Author
2012-10-22staging: usbip: Don't leak struct file.Bernard Blackham
usbip takes a reference on a struct file which is passed in via sysfs. Previously, this reference was never cleaned up, although the socket it referred to was. This patch drops the corresponding reference (found with the socket's ->file backpointer) instead of just closing the socket. Signed-off-by: Bernard Blackham <b-linuxgit@largestprime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging: usbip: fix the usage of kthread_stop()Oleg Nesterov
stub_shutdown_connection() and vhci_shutdown_connection() use task_is_dead() before kthread_stop(). This buys nothing and wrong. kthread_stop() is fine even if this thread is dead. However, if it is dead nothing protects this task_struct, we shouldn't touch this memory. Change the code to do the necessary get_task_struct/put_task_struct. This patch assumes that - xxx_shutdown_connection() is always called, so we can't leak the task_struct. - kthread_stop_put() can't be called twice on the same task. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Tobias Klauser <tklauser@distanz.ch> Cc: Matt Mooney <mfm@muteddisk.com>, Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-06-07usbip: change dev_attr_group to constantMárton Németh
The dev_attr_group variable is never changed and it is only passed to the second parameter of sysfs_create_group() and sysfs_remove_group() functions. These functions are defined in linux/sysfs.h: the second parameter is a pointer to const in both cases. Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07usbip: remove extra whitespaceMárton Németh
Only one whitespace is enough after "return". Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07usbip: remove check for negative values for an unsigned valueMárton Németh
The parameter rhport is unsigned so there is no need checking for negative values. This will remove the following warning message when compiling with "make W=1 ...": drivers/staging/usbip/vhci_sysfs.c: In function ‘valid_args’: drivers/staging/usbip/vhci_sysfs.c:138: warning: comparison of unsigned expression < 0 is always false Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-23Merge branch 'staging-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6 * 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (970 commits) staging: usbip: replace usbip_u{dbg,err,info} and printk with dev_ and pr_ staging:iio: Trivial kconfig reorganization and uniformity improvements. staging:iio:documenation partial update. staging:iio: use pollfunc allocation helpers in remaining drivers. staging:iio:max1363 misc cleanups and use of for_each_bit_set to simplify event code spitting out. staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev. staging:iio:meter:ade7758: Use private data space from iio_allocate_device staging:iio:accel:lis3l02dq make write_reg_8 take value not a pointer to value. staging:iio: ring core cleanups + check if read_last available in lis3l02dq staging:iio:core cleanup: squash tiny wrappers and use dev_set_name to handle creation of event interface name. staging:iio: poll func allocation clean up. staging:iio:ad7780 trivial unused header cleanup. staging:iio:adc: AD7780: Use private data space from iio_allocate_device + trivial fixes staging:iio:adc:AD7780: Convert to new channel registration method staging:iio:adc: AD7606: Drop dev_data in favour of iio_priv() staging:iio:adc: AD7606: Consitently use indio_dev staging:iio: Rip out helper for software rings. staging:iio:adc:AD7298: Use private data space from iio_allocate_device staging:iio: rationalization of different buffer implementation hooks. staging:iio:imu:adis16400 avoid allocating rx, tx, and state separately from iio_dev. ... Fix up trivial conflicts in - drivers/staging/intel_sst/intelmid.c: patches applied in both branches - drivers/staging/rt2860/common/cmm_data_{pci,usb}.c: removed vs spelling - drivers/staging/usbip/vhci_sysfs.c: trivial header file inclusion
2011-05-19staging: usbip: replace usbip_u{dbg,err,info} and printk with dev_ and pr_matt mooney
This switches all of the usbip_u{dbg,err,info} and printk statements to dev_<level>, if possible, or pr_<level> macros. And removes a few unnecessary debug statements. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-12staging: usbip: fix header includesmatt mooney
Modify header directives to include what is needed by each file and not already included in its own header. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06staging: usbip: vhci_sysfs.c: coding style cleanupmatt mooney
Fix a few alignment issues and remove extraneous lines. Add braces to else clause. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25staging: usbip: vhci: fix oops on subsequent attachMax Vozeler
vhci_rx/vhci_tx threads are created once but stopped each time the vdev is shut down. On subsequent attach wake_up_process() oopses trying to access the stopped threads. This patch does as before the kthread conversion which is to create the threads each time a device is attached and stop the threads when the device is shut down. Signed-off-by: Max Vozeler <max@hinterhof.net> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net> Cc: Arjan Mels <arjan.mels@gmx.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-02staging/usbip: convert to kthreadArnd Bergmann
usbip has its own infrastructure for managing kernel threads, similar to kthread. By changing it to use the standard functions, we can simplify the code and get rid of one of the last BKL users at the same time. Includes changes suggested by Max Vozeler. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net> Cc: Max Vozeler <max@vozeler.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-02USB: rename USB_SPEED_VARIABLE to USB_SPEED_WIRELESSGreg Kroah-Hartman
It's really the wireless speed, so rename the thing to make more sense. Based on a recommendation from David Vrabel Cc: David Vrabel <david.vrabel@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: USB-IP code cleanupBrian G. Merrell
This includes fixes for all of the legit checkpatch.pl errors and warnings. I have also included several of the suggestions from the linux-kernel mailing list when the USB-IP code was first added. Signed-off-by: Brian G. Merrell <bgmerrell@novell.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03Staging: BUG to BUG_ON changesStoyan Gaydarov
Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-06staging: struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-10Staging: USB/IP: add client driverTakahiro Hirofuchi
This adds the USB IP client driver Brian Merrell cleaned up a lot of this code and submitted it for inclusion. Greg also did a lot of cleanup. Signed-off-by: Brian G. Merrell <bgmerrell@novell.com> Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>