[PATCH] staging: rtl8188eu: Fix possible leak in rtl88eu_download_fw()

2015-02-13 Thread Christian Engelmayer
Function rtl88eu_download_fw() may leak the memory of the already requested firmware data due to direct returns in the error paths. Ensure cleanup by using a centralized exit path. Detected by Coverity CID 1269127. Signed-off-by: Christian Engelmayer --- Compile tested only. Applies against

[PATCH] staging: vt6656: Fix possible leak in vnt_download_firmware()

2015-02-11 Thread Christian Engelmayer
When failing to allocate buffer memory, function vnt_download_firmware() goes through the wrong exit path and fails to release the already requested firmware. Thus use the correct cleanup. Detected by Coverity CID 1269128. Signed-off-by: Christian Engelmayer --- Compile tested only. Applies

Re: [PATCH] staging: rtl8712: rtl871x_ioctl_linux.c: Cleaning up memory leak

2014-06-01 Thread Christian Engelmayer
On Sun, 1 Jun 2014 13:30:43 +0200, Rickard Strandqvist wrote: > There is a risk for memory leak in when something unexpected happens > and the function returns. > > This was largely found by using a static code analysis program called > cppcheck. > > Signed-off-by: Rickard Strandqvist > ---

Re: [PATCH] staging: rtl8712: rtl871x_mlme.c: Cleaning up memory leak

2014-06-01 Thread Christian Engelmayer
On Sun, 1 Jun 2014 13:32:20 +0200, Rickard Strandqvist wrote: > There is a risk for memory leak in when something unexpected happens > and the function returns. > > This was largely found by using a static code analysis program called > cppcheck. > > Signed-off-by: Rickard Strandqvist This

Re: [PATCH 2/2] staging: vt6656: fix leaks in error path

2014-05-30 Thread Christian Engelmayer
On Fri, 30 May 2014 20:47:44 +0200, Nicolas Thery wrote: > Fix memory leaks in ioctl error handling paths. > > Signed-off-by: Nicolas Thery > --- > drivers/staging/vt6656/hostap.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) This doesn't apply against staging-next. The change

Re: [PATCH 1/2] staging: rtl8188eu: fix usage of uninit scalar in rtw_drv_init()

2014-05-17 Thread Christian Engelmayer
On Sat, 17 May 2014 17:44:23 +0300, Dan Carpenter wrote: > On Sat, May 17, 2014 at 12:38:57PM +0200, Christian Engelmayer wrote: > > Function rtw_drv_init() is written in a way that assumes 'status' != > > _SUCCESS > > as long as not explicitly set. Thus initializ

[PATCH 1/2] staging: rtl8188eu: fix usage of uninit scalar in rtw_drv_init()

2014-05-17 Thread Christian Engelmayer
Function rtw_drv_init() is written in a way that assumes 'status' != _SUCCESS as long as not explicitly set. Thus initialize 'status' to FAIL, in order to prevent undefined behaviour if going through the exit paths. Detected by Coverity - CID 1077832. Signed-off-by:

[PATCH 2/2] staging: rtl8188eu: remove dead code in rtw_drv_init()

2014-05-17 Thread Christian Engelmayer
(status != _SUCCESS) immediately after 'status = _SUCCESS' will never evaluate true. Thus remove the logically dead code. Detected by Coverity - CID 1077553. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 -- 1 file changed, 2 deletions(-) di

[PATCH 0/2] staging: rtl8188eu: fix Coverity defects in rtw_drv_init()

2014-05-17 Thread Christian Engelmayer
git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git Christian Engelmayer (2): staging: rtl8188eu: fix usage of uninit scalar in rtw_drv_init() staging: rtl8188eu: remove dead code in rtw_drv_init() drivers/staging/rtl8188eu/os_dep/usb_intf.c | 4 +--- 1 file changed, 1 insertion(+), 3

Re: staging: dgap/dgnc maintainers list

2014-05-16 Thread Christian Engelmayer
On Fri, 16 May 2014 15:06:46 +0300, Dan Carpenter wrote: > On Fri, May 16, 2014 at 07:57:08AM -0400, Mark Hounschell wrote: > > On 05/16/2014 07:52 AM, Mark Hounschell wrote: > > > On 05/15/2014 06:49 PM, Dan Carpenter wrote: > > >> On Fri, May 16, 2014 at 12:27:01

staging: dgap/dgnc maintainers list

2014-05-15 Thread Christian Engelmayer
Hi, As I got a bit queued up for dgap, I just noticed that commit 542f3d5a states to add Mark to the maintainers list for dgap, while the patch addresses the dgnc entry. Was that the intention? https://lkml.org/lkml/2014/4/25/275 Regards, Christian --- commit 542f3d5af89c15d0b4e80bbf927d252efa

[PATCH v2 1/5] staging: rtl8188eu: fix potential leak in rtw_wx_read32()

2014-05-07 Thread Christian Engelmayer
Function rtw_wx_read32() dynamically allocates a temporary buffer that is not freed in all error paths. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - CID 1077711. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep

[PATCH v2] staging: vt6656: fix potential leak in vt6656_hostap_ioctl()

2014-05-07 Thread Christian Engelmayer
ot supported by this driver. Detected by Coverity - CID 144381. Signed-off-by: Christian Engelmayer --- v2: Resend after v1 failed to apply * rebased against staging-next - commit 09c3fbba (staging: rtl8188eu: Remove 'u8 *pbuf' from struct recv_buf) * fixed mua: no multipart,

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

2014-05-07 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 --- v3

[PATCH v3] staging: silicom: Remove unused pointer in bypass_init_module()

2014-05-07 Thread Christian Engelmayer
Pointer 'pbpctl_dev_c' in function bypass_init_module() is unused. Thus remove it. With the last variable declaration gone, there is no more need for an own block. Remove it and adapt the indenting accordingly. Signed-off-by: Christian Engelmayer --- v3: Resend after v2 faile

[PATCH v2 2/5] staging: rtl8188eu: fix potential leak in rtw_wx_set_enc_ext()

2014-05-07 Thread Christian Engelmayer
Function rtw_wx_set_enc_ext() dynamically allocates a temporary buffer that is not freed in all error paths. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - CID 1077712. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep

[PATCH v2] staging: binder: fix usage of uninit scalar in binder_transaction()

2014-05-07 Thread Christian Engelmayer
Fix the error path when a cookie mismatch is detected. In that case the function jumps to the exit label without setting the uninitialized, local variable 'return_error'. Detected by Coverity - CID 201453. Signed-off-by: Christian Engelmayer --- v2: Resend after v1 failed to apply

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

2014-05-07 Thread Christian Engelmayer
correctly. Detected by Coverity - CID 1077716, 1077717. Signed-off-by: Christian Engelmayer --- v3: Resend after v2 failed to apply * rebased against staging-next - commit 09c3fbba (staging: rtl8188eu: Remove 'u8 *pbuf' from struct recv_buf) * fixed mua: no multipart, 7bit text/plai

[PATCH v2] staging: comedi: ii_pci20kc: fix usage of uninit scalar in ii20k_attach()

2014-05-07 Thread Christian Engelmayer
the stack. Detected by Coverity - CID 1077830. Signed-off-by: Christian Engelmayer --- v2: Resend after v1 failed to apply * rebased against staging-next - commit 09c3fbba (staging: rtl8188eu: Remove 'u8 *pbuf' from struct recv_buf) * fixed mua: no multipart, 7bit text/pla

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

2014-05-07 Thread Christian Engelmayer
return is safe. Detected by Coverity - CID 144373. Signed-off-by: Christian Engelmayer --- v2: Resend after v1 failed to apply * rebased against staging-next - commit 09c3fbba (staging: rtl8188eu: Remove 'u8 *pbuf' from struct recv_buf) * fixed mua: no multipart, 7bit text/pla

[PATCH v2 4/5] staging: rtl8188eu: fix potential leak in rtw_mp_SetRFPath()

2014-05-07 Thread Christian Engelmayer
Function rtw_mp_SetRFPath() dynamically allocates a temporary buffer that is not freed in all error paths. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - CID 1077714. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep

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

2014-05-07 Thread Christian Engelmayer
Coverity - CID 144370, 144371. Signed-off-by: Christian Engelmayer --- v2: Resend after v1 failed to apply * rebased against staging-next - commit 09c3fbba (staging: rtl8188eu: Remove 'u8 *pbuf' from struct recv_buf) * fixed mua: no multipart, 7bit text/plain us-ascii Compile

[PATCH v2 5/5] staging: rtl8188eu: fix potential leak in rtw_mp_pwrtrk()

2014-05-07 Thread Christian Engelmayer
Function rtw_mp_pwrtrk() dynamically allocates a temporary buffer that is not freed in all error paths. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - 1077715. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep

[PATCH v2 0/5] staging: rtl8188eu: fix Coverity defects in os_dep/ioctl_linux.c

2014-05-07 Thread Christian Engelmayer
ove 'u8 *pbuf' from struct recv_buf) * fixed mua: no multipart, 7bit text/plain us-ascii The series is compile tested and applies against branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git Christian Engelmayer (5): staging: rtl8188eu: fix po

[PATCH v2 3/5] staging: rtl8188eu: fix potential leak in rtw_mp_QueryDrv()

2014-05-07 Thread Christian Engelmayer
Function rtw_mp_QueryDrv() dynamically allocates a temporary buffer that is not freed in all error paths. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - CID 1077713. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep

[PATCH v2] staging: silicom: Remove needless calls of get_status_port_fn()

2014-05-07 Thread Christian Engelmayer
Remove a needless pointer initialisation and call to get_status_port_fn() in functions remove_bypass_tpl_auto() and set_tpl_fn(). Variable 'pbpctl_dev_b' is set correctly later in the function before first use. Signed-off-by: Christian Engelmayer --- v2: Resend after v1 faile

[PATCH v2] staging: rtl8723au: Remove unused pointer in rtw_wdev_free()

2014-05-07 Thread Christian Engelmayer
Pointer 'pwdev_priv' in function rtw_wdev_free() is unused - thus remove it. Signed-off-by: Christian Engelmayer --- v2: Resend after v1 failed to apply * rebased against staging-next - commit 09c3fbba (staging: rtl8188eu: Remove 'u8 *pbuf' from struct recv_buf

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

2014-05-05 Thread Christian Engelmayer
On Sat, 3 May 2014 20:27:35 -0400, Greg KH wrote: > On Thu, May 01, 2014 at 11:54:02PM +0200, Christian Engelmayer wrote: > > Fix potential leaks in the error paths of r8712_set_key(). In case the > > algorithm specific checks fail, the function returns without enqueuing >

[PATCH] staging: comedi: ii_pci20kc: fix usage of uninit scalar in ii20k_attach()

2014-05-03 Thread Christian Engelmayer
the stack. Detected by Coverity - CID 1077830. Signed-off-by: Christian Engelmayer --- Compile tested and applies against branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git --- drivers/staging/comedi/drivers/ii_pci20kc.c | 1 + 1 file changed, 1 insertion(+) di

[PATCH] staging: binder: fix usage of uninit scalar in binder_transaction()

2014-05-03 Thread Christian Engelmayer
Fix the error path when a cookie mismatch is detected. In that case the function jumps to the exit label without setting the uninitialized, local variable 'return_error'. Detected by Coverity - CID 201453. Signed-off-by: Christian Engelmayer --- Compile tested and applies against bran

Re: Found some errors and other oddities, largely by means of a static code analysis program

2014-05-03 Thread Christian Engelmayer
On Sat, 3 May 2014 23:06:50 +0300, Dan Carpenter wrote: > Many of my other comments apply. > > > diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > index 23d539d..1d4475d 100644 > > --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux

[PATCH] staging: vt6656: fix potential leak in vt6656_hostap_ioctl()

2014-05-02 Thread Christian Engelmayer
at are also not supported by this driver. Detected by Coverity - CID 144381. Signed-off-by: Christian Engelmayer --- Compile tested and applies against branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git --- drivers/staging/vt6656/hostap.c | 6 -- 1 file change

[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

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

2014-05-01 Thread Christian Engelmayer
Coverity - CID 144370, 144371. Signed-off-by: Christian Engelmayer --- Compile tested and applies against branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git --- drivers/staging/rtl8712/rtl871x_mlme.c | 28 1 file changed, 20

[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

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'

[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-ne

[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-ne

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

2014-05-01 Thread Christian Engelmayer
return is safe. Detected by Coverity - CID 144373. Signed-off-by: Christian Engelmayer --- Compile tested and applies against branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 16 +--- 1 file

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

2014-05-01 Thread Christian Engelmayer
correctly. Detected by Coverity - CID 1077716, 1077717. Signed-off-by: Christian Engelmayer --- v2: Added changes requested by Dan Carpenter: * Just return directly where no cleanup is needed. * Prefer naming labels by the labeled action rather than the goto location. Compile tested and applies

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

2014-05-01 Thread Christian Engelmayer
correctly. Detected by Coverity - CID 1077716, 1077717. Signed-off-by: Christian Engelmayer --- Compile tested and applies against branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 15 ++- 1 file changed, 10

Re: [PATCH] staging: comedi: remove duplicate pointer assignments in attach functions

2014-04-29 Thread Christian Engelmayer
On Mon, 28 Apr 2014 22:36:13 +, Hartley Sweeten wrote: > Technically, these drivers are fine as-is. They are. The proposed change falls under minor code maintenance only. > They are all legacy comedi drivers and use the manual attach mechanism. The > dev->board pointer is setup by the comed

[PATCH 1/5] staging: rtl8188eu: fix potential leak in rtw_wx_read32()

2014-04-28 Thread Christian Engelmayer
Function rtw_wx_read32() dynamically allocates a temporary buffer that is not freed in all error paths. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - CID 1077711. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep

[PATCH 0/5] staging: rtl8188eu: fix Coverity defects in os_dep/ioctl_linux.c

2014-04-28 Thread Christian Engelmayer
/gregkh/staging.git Christian Engelmayer (5): staging: rtl8188eu: fix potential leak in rtw_wx_read32() staging: rtl8188eu: fix potential leak in rtw_wx_set_enc_ext() staging: rtl8188eu: fix potential leak in rtw_mp_QueryDrv() staging: rtl8188eu: fix potential leak in rtw_mp_SetRFPath() stag

[PATCH 2/5] staging: rtl8188eu: fix potential leak in rtw_wx_set_enc_ext()

2014-04-28 Thread Christian Engelmayer
Function rtw_wx_set_enc_ext() dynamically allocates a temporary buffer that is not freed in all error paths. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - CID 1077712. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep

[PATCH 3/5] staging: rtl8188eu: fix potential leak in rtw_mp_QueryDrv()

2014-04-28 Thread Christian Engelmayer
Function rtw_mp_QueryDrv() dynamically allocates a temporary buffer that is not freed in all error paths. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - CID 1077713. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep

[PATCH 4/5] staging: rtl8188eu: fix potential leak in rtw_mp_SetRFPath()

2014-04-28 Thread Christian Engelmayer
Function rtw_mp_SetRFPath() dynamically allocates a temporary buffer that is not freed in all error paths. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - CID 1077714. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep

[PATCH 5/5] staging: rtl8188eu: fix potential leak in rtw_mp_pwrtrk()

2014-04-28 Thread Christian Engelmayer
Function rtw_mp_pwrtrk() dynamically allocates a temporary buffer that is not freed in all error paths. Use a centralized exit path and make sure that all memory is freed correctly. Detected by Coverity - 1077715. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep

[PATCH v2] staging: silicom: Remove unused pointer in bypass_init_module()

2014-04-28 Thread Christian Engelmayer
Pointer 'pbpctl_dev_c' in function bypass_init_module() is unused. Thus remove it. With the last variable declaration gone, there is no more need for an own block. Remove it and adapt the indenting accordingly. Signed-off-by: Christian Engelmayer --- v2: Added changes requested by Dan

[PATCH] staging: silicom: Remove unused pointer in bypass_init_module()

2014-04-26 Thread Christian Engelmayer
Pointer 'pbpctl_dev_c' in function bypass_init_module() is unused. Thus remove it. Signed-off-by: Christian Engelmayer --- Compile tested and applies against v3.15-rc2 as well as branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git --- drivers/stagi

[PATCH] staging: silicom: Remove needless calls of get_status_port_fn()

2014-04-26 Thread Christian Engelmayer
Remove a needless pointer initialisation and call to get_status_port_fn() in functions remove_bypass_tpl_auto() and set_tpl_fn(). Variable 'pbpctl_dev_b' is set correctly later in the function before first use. Signed-off-by: Christian Engelmayer --- Compile tested and applies against

[PATCH] staging: rtl8723au: Remove unused pointer in rtw_wdev_free()

2014-04-26 Thread Christian Engelmayer
Pointer 'pwdev_priv' in function rtw_wdev_free() is unused - thus remove it. Signed-off-by: Christian Engelmayer --- Compile tested and applies against v3.15-rc2 as well as branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git --- drivers/staging

[PATCH] staging: comedi: remove duplicate pointer assignments in attach functions

2014-04-26 Thread Christian Engelmayer
is setup correctly. Signed-off-by: Christian Engelmayer --- Compile tested and applies against v3.15-rc2 as well as branch staging-next of tree git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git --- drivers/staging/comedi/drivers/das1800.c | 2 +- drivers/staging/comedi/driv

[PATCH] staging: vt6655: Fix memory leak in wpa_ioctl()

2014-01-11 Thread Christian Engelmayer
Fix a memory leak in the wpa_ioctl() error handling path so that 'param' is also freed correctly in case of an unsupported ioctl. Detected by Coverity: CID 144380. Signed-off-by: Christian Engelmayer --- drivers/staging/vt6655/wpactl.c | 4 ++-- 1 file changed, 2 insertions(+), 2