[PATCH v2] staging: rtl8723au: fix potential leak in update_bcn_wps_ie()

2014-05-01 Thread Christian Engelmayer
Fix a potential leak in the error path of function update_bcn_wps_ie(). Move the affected input verification to the beginning of the function so that it may return directly without leaking already allocated memory. Detected by Coverity - CID 1077718. Signed-off-by: Christian Engelmayer --- v2: Ad

[PATCH] staging: rtl8712: fix potential leaks in r8712_set_key()

2014-05-01 Thread Christian Engelmayer
Fix potential leaks in the error paths of r8712_set_key(). In case the algorithm specific checks fail, the function returns without enqueuing or freeing the already allocated command and parameter structs. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Cov

[PATCH v2] staging: rtl8188eu: fix potential leak in update_bcn_wps_ie()

2014-05-01 Thread Christian Engelmayer
Fix a potential leak in the error path of function update_bcn_wps_ie(). Move the affected input verification to the beginning of the function so that it may return directly without leaking already allocated memory. Detected by Coverity - CID 1077718. Signed-off-by: Christian Engelmayer --- v2: Ad

Re: [PATCH] staging: rtl8723au: fix potential leak in update_bcn_wps_ie()

2014-05-01 Thread Jes Sorensen
Christian Engelmayer writes: > On Thu, 1 May 2014 14:22:17 +0200, Mateusz Guzik wrote: >> On Thu, May 01, 2014 at 01:57:27PM +0200, Christian Engelmayer wrote: >> > Fix a potential leak in the error path of function update_bcn_wps_ie(). >> > Make sure that allocated memory for 'pbackup_remainder_

Re: [PATCH] staging: rtl8723au: fix potential leak in update_bcn_wps_ie()

2014-05-01 Thread Christian Engelmayer
On Thu, 1 May 2014 14:22:17 +0200, Mateusz Guzik wrote: > On Thu, May 01, 2014 at 01:57:27PM +0200, Christian Engelmayer wrote: > > Fix a potential leak in the error path of function update_bcn_wps_ie(). > > Make sure that allocated memory for 'pbackup_remainder_ie' is freed > > upon return. Detec

Re: [PATCH 00/32] staging: comedi: continue async command cleanup

2014-05-01 Thread Ian Abbott
On 2014-05-01 17:31, Hartley Sweeten wrote: BTW, what's with all the NI_GPCT_* stuff in the main comedi.h header? These all seem pretty driver specific to ni_tio.c and ni_tiocmd.c. I don't understand why they are exposed in the user space header. Basically for the same reason the 8254 mode val

RE: [PATCH 0/2] staging: comedi: correct upper bound check for 8254 mode

2014-05-01 Thread Hartley Sweeten
On Thursday, May 01, 2014 9:38 AM, Ian Abbott wrote: > Hartley spotted a bug in the upper bound check for the counter 'mode' > value in `i8254_set_mode()` (and the similar `i8254_mm_set_mode()` for > memory-mapped registers). The same incorrect upper bound check was used > in the "amplc_dio200_com

[PATCH 0/2] staging: comedi: correct upper bound check for 8254 mode

2014-05-01 Thread Ian Abbott
Hartley spotted a bug in the upper bound check for the counter 'mode' value in `i8254_set_mode()` (and the similar `i8254_mm_set_mode()` for memory-mapped registers). The same incorrect upper bound check was used in the "amplc_dio200_common" module which uses its own function to set the counter mo

[PATCH 2/2] staging: comedi: amplc_dio200_common: correct bound on counter mode

2014-05-01 Thread Ian Abbott
For the mode configured by the `INSN_CONFIG_SET_COUNTER_MODE` comedi instruction for the counter subdevice channels supported by this module, the upper bound should be `I8254_MODE5 | I8254_BCD` ((5 << 1) | 1) rather than `I8254_MODE5 | I8254_BINARY` ((5 << 1) | 0). Fix it. Reported-by: Hartley Sw

[PATCH 1/2] staging: comedi: drivers: correct mode check for i8254_set_mode()

2014-05-01 Thread Ian Abbott
The upper bound check on the `mode` parameter of `i8254_set_mode()` and `i8254_mm_set_mode()` is incorrect. The `mode` parameter value consists of a mode number in the range 0 to 5 in bits 3..1 {represented by the constants `I8254_MODE0` (0 << 1) through to `I8254_MODE5` (2 << 1)} ORed with a BCD/

RE: [PATCH 00/32] staging: comedi: continue async command cleanup

2014-05-01 Thread Hartley Sweeten
On Thursday, May 01, 2014 2:46 AM, Ian Abbott wrote: > On 2014-04-30 17:46, Hartley Sweeten wrote: >> On Wednesday, April 30, 2014 2:13 AM, Ian Abbott wrote: >>> As a side node, I wonder if it's worth stripping out those `| >>> I8254_BINARY` bits as it's basically 'OR'ing with zero anyway. >> >> I

Re: [PATCH] staging: rtl8723au: fix potential leak in update_bcn_wps_ie()

2014-05-01 Thread Mateusz Guzik
On Thu, May 01, 2014 at 01:57:27PM +0200, Christian Engelmayer wrote: > Fix a potential leak in the error path of function update_bcn_wps_ie(). > Make sure that allocated memory for 'pbackup_remainder_ie' is freed > upon return. Detected by Coverity - CID 1077718. > if (remainder_ielen >

[PATCH] staging: rtl8188eu: fix potential leak in update_bcn_wps_ie()

2014-05-01 Thread Christian Engelmayer
Fix a potential leak in the error path of function update_bcn_wps_ie(). Make sure that allocated memory for 'pbackup_remainder_ie' is freed upon return. Detected by Coverity - CID 1077718. Signed-off-by: Christian Engelmayer --- Compile tested and applies against branch staging-next of tree git.k

[PATCH] staging: rtl8723au: fix potential leak in update_bcn_wps_ie()

2014-05-01 Thread Christian Engelmayer
Fix a potential leak in the error path of function update_bcn_wps_ie(). Make sure that allocated memory for 'pbackup_remainder_ie' is freed upon return. Detected by Coverity - CID 1077718. Signed-off-by: Christian Engelmayer --- Compile tested and applies against branch staging-next of tree git.k

Re: [PATCH v2] staging: rtl8188eu: fix potential leak in rtw_set_key()

2014-05-01 Thread Dan Carpenter
On Thu, May 01, 2014 at 12:30:57PM +0200, Christian Engelmayer wrote: > Fix a potential leak in the error path of rtw_set_key(). In case the requested > algorithm is not supported by the driver, the function returns without > enqueuing or freeing the already allocated command and parameter structs.

[PATCH] staging: rtl8712: fix potential leak in r871x_wx_set_enc_ext()

2014-05-01 Thread Christian Engelmayer
Fix a potential leak in the error path of r871x_wx_set_enc_ext(). In case the requested algorithm is not supported by the driver, the function returns without freeing the already allocated 'param' struct. Move the input verification to the beginning of the function so that the direct return is safe

[PATCH v2] staging: rtl8188eu: fix potential leak in rtw_set_key()

2014-05-01 Thread Christian Engelmayer
Fix a potential leak in the error path of rtw_set_key(). In case the requested algorithm is not supported by the driver, the function returns without enqueuing or freeing the already allocated command and parameter structs. Use a centralized exit path and make sure that all memory is freed correctl

Re: [PATCH 00/32] staging: comedi: continue async command cleanup

2014-05-01 Thread Ian Abbott
On 2014-04-30 17:46, Hartley Sweeten wrote: On Wednesday, April 30, 2014 2:13 AM, Ian Abbott wrote: As a side node, I wonder if it's worth stripping out those `| I8254_BINARY` bits as it's basically 'OR'ing with zero anyway. I like the I8254_BINARY, it documents the mode that the counter is us

Re: [PATCH] staging: rtl8188eu: fix potential leak in rtw_set_key()

2014-05-01 Thread Dan Carpenter
On Thu, May 01, 2014 at 10:38:11AM +0200, Christian Engelmayer wrote: > Fix a potential leak in the error path of rtw_set_key(). In case the requested > algorithm is not supported by the driver, the function returns without > enqueuing or freeing the already allocated command and parameter structs.

Re: [PATCH] staging: comedi: fix coding style issues in comedi_fops.c

2014-05-01 Thread Ian Abbott
On 2014/05/01 09:23 AM, Raghavendra Ganiga wrote: > This is a patch to fix coding style > warnings found by checkpatch.pl tool > > Signed-off-by: Raghavendra Chandra Ganiga > --- > drivers/staging/comedi/comedi_fops.c |2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/staging

Re: [PATCH] staging: comedi: fix coding style issues in comedi_fops.c

2014-05-01 Thread Ian Abbott
On 2014/04/30 06:34 PM, Raghavendra Ganiga wrote: > This is a patch to fix coding style > warnings found by the checkpatch.pl tool > > Signed-off-by: Raghavendra Chandra Ganiga > --- > drivers/staging/comedi/comedi_fops.c |6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff

[PATCH] staging: rtl8188eu: fix potential leak in rtw_set_key()

2014-05-01 Thread Christian Engelmayer
Fix a potential leak in the error path of rtw_set_key(). In case the requested algorithm is not supported by the driver, the function returns without enqueuing or freeing the already allocated command and parameter structs. Use a centralized exit path and make sure that all memory is freed correctl

[PATCH] staging: comedi: fix coding style issues in comedi_fops.c

2014-05-01 Thread Raghavendra Ganiga
This is a patch to fix coding style warnings found by checkpatch.pl tool Signed-off-by: Raghavendra Chandra Ganiga --- drivers/staging/comedi/comedi_fops.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index

[PATCH] staging: binder: cleanup dereference of noderef expressions

2014-05-01 Thread Jerry Snitselaar
Clean up sparse warnings for cred struct dereference. Signed-off-by: Jerry Snitselaar --- drivers/staging/android/binder.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index fc59281..6279d82 100