[PATCH v3] staging: kpc2000: remove unnecessary assertions in kpc_dma_transfer

2019-12-19 Thread Aditya Pakki
In kpc_dma_transfer(), the assertion that priv is NULL and priv->ldev is NULL, are never satisfied. The two callers of the function, dereference the fields before the function is called. This patch removes the two BUG_ON calls. Signed-off-by: Aditya Pakki --- v2: Also remove BUG_ON call for l

[PATCH v2] staging: kpc2000: remove unnecessary assertion on priv

2019-12-17 Thread Aditya Pakki
In kpc_dma_transfer(), the assertion that priv is NULL is never satisfied. The two callers of the function, dereference the priv pointer before the call is executed. This patch removes the unnecessary BUG_ON call. Signed-off-by: Aditya Pakki --- v1: Replace the recovery code by removing the

[PATCH] staging: kpc2000: replace assertion with recovery code

2019-12-15 Thread Aditya Pakki
In kpc_dma_transfer, if either priv or ldev is NULL, crashing the process is excessive and is not needed. Instead of asserting, by passing the error upstream, the error can be handled. Signed-off-by: Aditya Pakki --- drivers/staging/kpc2000/kpc_dma/fileops.c | 6 -- 1 file changed, 4

[PATCH v3] staging: rtl8188eu: Fix potential NULL pointer dereference of kcalloc

2019-03-20 Thread Aditya Pakki
hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem by returning error upstream in rtl8723bs, rtl8188eu. Signed-off-by: Aditya Pakki --- v2: Move signed off above version change log. v1: Return error and remove print in case of

[PATCH v3] staging: rtlwifi: rtl8822b: fix to avoid NULL pointer dereference

2019-03-20 Thread Aditya Pakki
skb allocated via dev_alloc_skb can fail and return a NULL pointer. This patch avoids such a scenario and returns, consistent with other invocations. Signed-off-by: Aditya Pakki --- v2: Move signed off above the version change log v1: Patch collision with rtl_phydm.c, fix as per Greg

[PATCH v3] staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc

2019-03-20 Thread Aditya Pakki
phydm.internal is allocated using kzalloc which is used multiple times without a check for NULL pointer. This patch avoids such a scenario by returning 0, consistent with the failure case. Signed-off-by: Aditya Pakki --- v2: Move the signed off line above v1: Patch collision with different

[PATCH v2] staging: rtl8188eu: Fix potential NULL pointer dereference

2019-03-19 Thread Aditya Pakki
hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem by returning an error in rtl8723bs. --- v1: Return error and remove print in case of failure, per Greg Signed-off-by: Aditya Pakki --- drivers/staging/rtl8188eu/core/rtw_xmit.c

[PATCH v2] staging: rtlwifi: rtl8822b: fix to avoid NULL pointer dereference

2019-03-19 Thread Aditya Pakki
skb allocated via dev_alloc_skb can fail and return a NULL pointer. This patch avoids such a scenario and returns, consistent with other invocations. --- v1: Patch collision with rtl_phydm.c, fix as per Greg Signed-off-by: Aditya Pakki --- drivers/staging/rtlwifi/rtl8822be/fw.c | 2 ++ 1 file

[PATCH v2] staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc

2019-03-19 Thread Aditya Pakki
phydm.internal is allocated using kzalloc which is used multiple times without a check for NULL pointer. This patch avoids such a scenario. -- v1: Patch collision with different things, fix as per Greg Signed-off-by: Aditya Pakki --- drivers/staging/rtlwifi/phydm/rtl_phydm.c | 2 ++ 1 file

[PATCH] staging: rtl8188eu: Fix potential NULL pointer dereference

2019-03-13 Thread Aditya Pakki
hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem similar to rtl8723bs. Signed-off-by: Aditya Pakki --- drivers/staging/rtl8188eu/core/rtw_xmit.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/rtl8188eu

[PATCH] staging: rtlwifi: Fix potential NULL pointer dereference

2019-03-13 Thread Aditya Pakki
skb allocated via dev_alloc_skb can fail and return a NULL pointer. This patch avoids such a scenario and returns, consistent with other invocations. Signed-off-by: Aditya Pakki --- drivers/staging/rtlwifi/rtl8822be/fw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging

[PATCH] staging: rtlwifi: Fix potential NULL pointer dereference

2019-03-13 Thread Aditya Pakki
phydm.internal is allocated using kzalloc which is used multiple times without a check for NULL pointer. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/staging/rtlwifi/phydm/rtl_phydm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/rtlwifi

[PATCH] [v3] staging: rtl8723bs: Clean up dead code

2019-01-07 Thread Aditya Pakki
ever, maintainers identified the patch fixing the issue is not required as function rts_wps_start() is dead code and can be removed. Signed-off-by: Aditya Pakki --- .../staging/rtl8723bs/os_dep/ioctl_linux.c| 34 +-- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/dri

[PATCH] v2 staging: rtl8723bs: Clean up dead code

2019-01-06 Thread Aditya Pakki
rtw_wps_start() is part of dead code due to CONFIG_INTEL_WIDI. The fix removes the deadcode and replaces the function with NULL in rtw_private_handler. Identified as part of copy_from_user bug. Signed-off-by: Aditya Pakki --- .../staging/rtl8723bs/os_dep/ioctl_linux.c| 34

[PATCH] Staging: rts5208: Fix error handling on rtsx_send_cmd

2019-01-05 Thread Aditya Pakki
In sd_execute_write_data, the rtsx_send_cmd could fail with ETIMEDOUT or EIO. The fix adds a check to handle these failures. Signed-off-by: Aditya Pakki --- drivers/staging/rts5208/sd.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rts5208/sd.c b

[PATCH] staging: rts5208: Add a check for ms_read_extra_data

2018-12-27 Thread Aditya Pakki
In ms_copy_page, the function ms_read_extra_data may fail for many reasons. The fix adds a check similar to other invocation to return error upstream. Signed-off-by: Aditya Pakki --- drivers/staging/rts5208/ms.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH] rts5208: Add a check on the status of ms_send_cmd

2018-12-24 Thread Aditya Pakki
In mspro_stop_seq_mode(), ms_send_cmd() may fail. The patch attempts to detect a failure before flushing the registers via rtsx_write_register. Signed-off-by: Aditya Pakki --- drivers/staging/rts5208/ms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging

[PATCH] rtl8723bs/ioctl_linux: Add a security check to copy_from_user()

2018-12-23 Thread Aditya Pakki
Currently, the return value of copy_from_user is not checked. extra is assigned to u32wps_start irrespective of these failures. Signed-off-by: Aditya Pakki --- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers