summaryrefslogtreecommitdiff
path: root/drivers/staging/bcm
AgeCommit message (Collapse)Author
2012-03-02Staging: bcm: fix possible memory leak of 'pstAddIndication' in CmHost.c and ↵Kevin McKinney
removes a whitespace Memory is being allocated by kmalloc and stored in variable pstAddIndication. However, this memory is not being freed in all cases. Therefore, this patch frees it on several exit paths. This patch also removes a whitespace. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24Staging: bcm: fix possible NULL dereference of psfLocalSet in CmHost.cKevin McKinney
Variable psfLocalSet may not follow the correct path in the code, and therefore may not be set properly. As such, causing a null dereference. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13Staging: bcm: Move directives for the preprocessor statement to enum value ↵Kevin McKinney
in led_control.h DRIVER_HALT is a driver state that was originally defined as a #define statement. This patch moves it to the LedEvents type as an enumerated value for the purpose of removing a compile time warning: drivers/staging/bcm/led_control.c: In function ‘LEDControlThread’: drivers/staging/bcm/led_control.c:817:3: warning: case value ‘255’ not in enumerated type ‘LedEventInfo_t’ [-Wswitch] Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10Staging: bcm: fix CodingStyle warnings/errors reported by checkpatch.pl in ↵Gerard Ryan
led_control.h This is a patch to the led_control.h file that fixes numerous warnings and errors reported by the checkpatch.pl tool. There still remain a few more, but as this is my first attempt at a commit, I'm not going to be too adventurous! Signed-off-by: Gerard Ryan <gerard@ryan.lt> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08Staging: bcm: Use memdup_user rather than duplicating its implementationThomas Meyer
This is a little bit restricted to reduce false positives The semantic patch that makes this change is available in scripts/coccinelle/api/memdup_user.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08Staging: bcm: Alter name, datatype, and default value of iterator variables.Kevin McKinney
This patch renames variables used in iteration statements with i, changes the datatype to int, and removes any default value. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08Staging: bcm: Replace variables and function outputs defined as INT with int.Kevin McKinney
This patch replaces all variables and function output that have a datatype definition of "INT" with "int". Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08Staging: bcm: Remove assignment from if statement and reverse if logic for ↵Kevin McKinney
readability. This patch removes an assignment from an if statement, and it reverses the logic in several if statements to make them more readable and understandable. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08Staging: bcm: Remove typedef from CmHost.c and use enum.Kevin McKinney
This patch removes a typedef from a variable definition in CmHost.c, and uses a enum instead. This Warning was reported by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08Staging: bcm: Replace dated variable __FUNCTION__.Kevin McKinney
This patch replaces the obsolete variable, __FUNCTION__, that holds the name of the current function with variable, __func__. Reported by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08Staging: bcm: Fix coding style issues in CmHost.cKevin McKinney
This patch cleans up several code style issues found in CmHost.c reported by checkpatch.pl. These include: white space, braces, indents, and comments. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08Staging: bcm: Fix an integer overflow in IOCTL_BCM_NVM_READ/WRITEKevin McKinney
Variables stNVMReadWrite.uioffset and stNVMReadWrite.uiNumBytes are chosen from userspace and can be very high. The sum of these two digits would result in a small number. Therefore, this patch verifies a negative number was not entered, and reorganizes the equation to remove the integer overflow. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-01-09Merge branch 'staging-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging * 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (466 commits) net/hyperv: Add support for jumbo frame up to 64KB net/hyperv: Add NETVSP protocol version negotiation net/hyperv: Remove unnecessary kmap_atomic in netvsc driver staging/rtl8192e: Register against lib80211 staging/rtl8192e: Convert to lib80211_crypt_info staging/rtl8192e: Convert to lib80211_crypt_data and lib80211_crypt_ops staging/rtl8192e: Add lib80211.h to rtllib.h staging/mei: add watchdog device registration wrappers drm/omap: GEM, deal with cache staging: vt6656: int.c, int.h: Change return of function to void staging: usbip: removed unused definitions from header staging: usbip: removed dead code from receive function staging:iio: Drop {mark,unmark}_in_use callbacks staging:iio: Drop buffer mark_param_change callback staging:iio: Drop the unused buffer enable() and is_enabled() callbacks staging:iio: Drop buffer busy flag staging:iio: Make sure a device is only opened once at a time staging:iio: Disallow modifying buffer size when buffer is enabled staging:iio: Disallow changing scan elements in all buffered modes staging:iio: Use iio_buffer_enabled instead of open coding it ... Fix up conflict in drivers/staging/iio/adc/ad799x_core.c (removal of module_init due to using module_i2c_driver() helper, next to removal of MODULE_ALIAS due to using MODULE_DEVICE_TABLE instead).
2012-01-02misc latin1 to utf8 conversionsAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-22Staging: bcm: Fix an invalid dereference to a kmalloc in IOCTL_BCM_BULK_WRMKevin McKinney
Variable IoBuffer.InputLength is chosen from userspace, and can therefore be less than the intended size. In this case,the memory from the kmalloc call is eventually cast to a PBULKWRM_BUFFER. If the IoBuffer.InputLength does not meet the minimum size of PBULKWRM_BUFFER, then we will get a kernel Oops. To resolve this issue, this patch verifies IoBuffer.InputLength meets the minimum size before invoking the kmalloc call. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-22Staging: bcm: Fix information leak in IOCTL_BCM_GET_DRIVER_VERSIONKevin McKinney
This ioctl, IOCTL_BCM_GET_DRIVER_VERSION, is responsible for sending the driver version to userspace. However, the requested size stored in IoBuffer.OutputLength may be incorrect. Therefore, we altered the code to send the exact length of the version, plus one for the null character. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12staging: bcm: HandleControlPacket.c: breaking of long linesJohannes Tenschert
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12staging: bcm: HandleControlPacket.c: fix parens/bracesJohannes Tenschert
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12staging: bcm: HandleControlPacket.c: fix commentsJohannes Tenschert
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12staging: bcm: HandleControlPacket.c: fix indentationJohannes Tenschert
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12staging: bcm: HandleControlPacket.c: fix whitespacesJohannes Tenschert
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging: bcm: led_control.c: breaking of long linesJohannes Tenschert
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging: bcm: led_control.c: fix parens/bracesJohannes Tenschert
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging: bcm: led_control.c: fix commentsJohannes Tenschert
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging: bcm: led_control.c: fix indentationJohannes Tenschert
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging: bcm: led_control.c: fix whitespacesJohannes Tenschert
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08Staging: bcm: Alter return value for copy_to/from_user() to "return -EFAULT" ↵Kevin McKinney
when an error occurs. In this clean up patch, I altered functions: copy_to/ from_user() to return -EFAULT when an error occurs. I also replaced break statements when an error occurs from copy_to/from_user() with direct returns of -EFAULT. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08Staging: bcm: Alter code to move error handling closer to the calls; and ↵Kevin McKinney
remove white space, IOCTL_BCM_NVM_WRITE. This is a clean up patch for IOCTL_BCM_NVM_WRITE that replaces the assignment of the Status variable with direct returns of the error code, replaces the break statements with direct returns, and removes a white space. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08Staging: bcm: Fix double free of 'pReadData' in IOCTL_BCM_NVM_WRITE.Kevin McKinney
This patch fixes a memory error in ioctl, IOCTL_BCM_NVM_WRITE. While copying data to user space, if an error occurs, pReadData is freed. Then, at the end of the ioctl, pReadData was being freed again. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29Staging: bcm: Reverse semaphore locking in IOCTL_BCM_BUFFER_DOWNLOAD_STOP.Kevin McKinney
This patch reorders the semaphore locking. It makes better sense to first evaluate fw_download_sema semaphore then NVMRdmWrmLocl semaphore. The fw_download_sema is suppose to be acquired in the START ioctl. If this is not true, then it does not make sense to continue. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29Staging: bcm: Alter code to move error handling closer to the calls.Kevin McKinney
This is a cleanup patch. I've shuffled the code around to move the error handling closer to the calls. I've removed some indent levels. I've replaced break statements with direct returns. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29Staging: bcm: Clean up patch that calls semaphore down_trylock directly.Kevin McKinney
This patch evaluates/calls the down_trylock locking function directly, instead of storing the results in a variable and evaluating the variable. These changes were made in: IOCTL_BCM_BUFFER_DOWNLOAD_STOP and IOCTL_BCM_BUFFER_DOWNLOAD_START. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26Staging: bcm: Fix semaphore locking error when downloading firmware.Kevin McKinney
This patch releases semaphore locks when an error occurrs while attempting to download firmware for the bcm driver. When downloading firmware for this driver, a process is expected to call the following ioctl's in this order: (1)IOCTL_BCM_BUFFER_DOWNLOAD_START, (2)IOCTL_BCM_BUFFER_DOWNLOAD, and (3) IOCTL_BCM_BUFFER_DOWNLOAD_STOP. Semaphore, “Adapter->fw_download_sema” is expected to be acquired in the first ioctl, IOCTL_BCM_BUFFER_DOWNLOAD_START, and it should block until IOCTL_BCM_BUFFER_DOWNLOAD_STOP is called. In this case, if an error occurred before STOP finished, the semaphore "Adapter->fw_download_sema" was not being released. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26Staging: bcm: Fix semaphore locking bug in, IOCTL_BCM_BUFFER_DOWNLOADKevin McKinney
In this ioctl, we are testing to see if the lock is held. If it is not held, that means this ioctl used incorrectly. Therefore, we do not want to take the lock ourselves here. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26Staging: bcm: Remove unnecessary "do while" statement in, ↵Kevin McKinney
IOCTL_BCM_BUFFER_DOWNLOAD This patch removes a superfluous "do while" statement in IOCTL_BCM_BUFFER_DOWNLOAD. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26Staging: bcm: Clean up code in ioctl: IOCTL_BCM_EEPROM_REGISTER_READKevin McKinney
This patch verifies two conditions before executing a kmalloc call. First, it checks to see that IoBuffer.OutputLength is not greater than an unsigned short. If so, an invalid value may be returned. The second change is a check to make sure IoBuffer.OutputLength is not equal to zero. Which simply keeps this code inline with the other ioctl, IOCTL_BCM_REGISTER_READ_PRIVATE. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26Staging: bcm: Fix information leak in ioctl: ↵Kevin McKinney
IOCTL_BCM_REGISTER_READ_PRIVATE, IOCTL_BCM_EEPROM_REGISTER_READ This patch fixes an information leak in ioctl IOCTL_BCM_REGISTER_READ_PRIVATE and IOCTL_BCM_EEPROM_REGISTER_READ when determining the number of bytes to copy to user space. Function, usb_control_msg, returns the correct number of bytes from the hardware. Instead of using this value, we were using a value derived from user space. In this case, this value could be more than the hardware allocated. Therefore, this patch copies the proper number of bytes from the hardware, and uses this value as the maximum number of bytes for user space. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26Staging: bcm: hostmibs: Added temporary variable to shorten linesDiego F. Marfil
Signed-off-by: Diego F. Marfil <diegomarfil@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26Staging: bcm: hostmibs: White spaces and indentation fixes.Diego F. Marfil
Signed-off-by: Diego F. Marfil <diegomarfil@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26Staging: bcm: hostmibs: C99 comments replacedDiego F. Marfil
Signed-off-by: Diego F. Marfil <diegomarfil@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23Staging: bcm: Fix three initialization errors in InterfaceDld.cKevin McKinney
This patch fixes three initialization errors. One is an incorrect initialization of a static variable. The other two are incorrect initializations in an if statement. These errors were found by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23Staging: bcm: Fix coding style issues in InterfaceDld.cKevin McKinney
This patch fixes multiple coding style issues in file, InterfaceDld.c, found by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: bcm: Fix coding style issues in InterfaceMisc.cKevin McKinney
This patch cleans up several code style issues found in InterfaceMisc.c reported by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: bcm: Remove assignment from if conditions reported by checkpatch.plKevin McKinney
This patch removes an assignment from three if conditions. In all three cases, the line of code was attempting to allocate memory, and check if the memory was allocated in the if statement. This issue was reported by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: bcm: Fix coding style issues reported by checkpatch.plKevin McKinney
This patch cleans up several code style issues found in InterfaceInit.c reported by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: bcm: Fix assignment issue in if statement reported by checkpatch.pl.Kevin McKinney
This patch fixes an error where an assignment "=" was being used in an if statement to determine if Firmware was downloaded. This patch removes that assignment, and places it above the if statement. The if statement then evaluates the status to verify if "0" successful, or != 0 failure. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: bcm: Remove assignment in if condition reported by checkpatch.plKevin McKinney
There is a case where an assignment was being done in an if condition. This patch removes the assignment from the if condition and places the assignment above the if statement; thereby improving the readability of the code. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: bcm: Replace dated variable __FUNCTION__ reported by checkpatch.plKevin McKinney
This patch replaces the obsolete variable, __FUNCTION__, that holds the name of the current function with variable, __func__. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: bcm: Fix coding style issues reported by checkpatch.plKevin McKinney
This patch cleans up several hundred code style issues found in Misc.c reported by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29Staging: bcm: Alter LOC for readability/understandability purposesKevin McKinney
This patch alters a line of code to make it more readable and easier to understand. The purpose of the original line of code was to compute the amount of memory to request from kmalloc. This mulit-step algorithm was being done in one line of code, thus making it more difficult to understand. Therefore, I split this algorithm into three logical steps. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>