mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [v3] staging: rtl8723bs: Clean up dead code
@ 2019-01-07 23:20 Aditya Pakki
  2019-01-08  9:57 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2019-01-07 23:20 UTC (permalink / raw)
  To: pakki001
  Cc: Greg Kroah-Hartman, Quytelda Kahja, Michael Straube,
	Mamta Shukla, Wen Yang, Arushi Singhal, devel, linux-kernel

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.

Changes from v1 & 2:
The return value of copy_from_user() is not checked appropriately.
However, 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 <pakki001@umn.edu>
---
 .../staging/rtl8723bs/os_dep/ioctl_linux.c    | 34 +------------------
 1 file changed, 1 insertion(+), 33 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 8fb03efd588b..2621c47f343f 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -2568,38 +2568,6 @@ static int rtw_set_pid(struct net_device *dev,
 
 }
 
-static int rtw_wps_start(struct net_device *dev,
-                               struct iw_request_info *info,
-                               union iwreq_data *wrqu, char *extra)
-{
-
-	int ret = 0;
-	struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
-	struct iw_point *pdata = &wrqu->data;
-	u32   u32wps_start = 0;
-        unsigned int uintRet = 0;
-
-	if ((true == padapter->bDriverStopped) ||(true ==padapter->bSurpriseRemoved) || (NULL == pdata)) {
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	uintRet = copy_from_user((void*)&u32wps_start, pdata->pointer, 4);
-	if (u32wps_start == 0)
-		u32wps_start = *extra;
-
-	DBG_871X("[%s] wps_start = %d\n", __func__, u32wps_start);
-
-#ifdef CONFIG_INTEL_WIDI
-	process_intel_widi_wps_status(padapter, u32wps_start);
-#endif /* CONFIG_INTEL_WIDI */
-
-exit:
-
-	return ret;
-
-}
-
 static int rtw_p2p_set(struct net_device *dev,
                                struct iw_request_info *info,
                                union iwreq_data *wrqu, char *extra)
@@ -4820,7 +4788,7 @@ static iw_handler rtw_private_handler[] = {
 	rtw_get_ap_info,					/* 0x04 */
 
 	rtw_set_pid,						/* 0x05 */
-	rtw_wps_start,					/* 0x06 */
+	NULL,					/* 0x06 */
 
 /*  for PLATFORM_MT53XX */
 	rtw_wx_get_sensitivity,			/* 0x07 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [v3] staging: rtl8723bs: Clean up dead code
  2019-01-07 23:20 [PATCH] [v3] staging: rtl8723bs: Clean up dead code Aditya Pakki
@ 2019-01-08  9:57 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2019-01-08  9:57 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: Arushi Singhal, devel, Greg Kroah-Hartman, linux-kernel,
	Mamta Shukla, Quytelda Kahja, Wen Yang

Your subject does work for `git am` but the more normal way to format
it is:

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

On Mon, Jan 07, 2019 at 05:20:52PM -0600, Aditya Pakki wrote:
> 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.
> 
> Changes from v1 & 2:
> The return value of copy_from_user() is not checked appropriately.
> However, 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 <pakki001@umn.edu>
> ---

The "Changed from" comments need to go here under the --- cut off line.
It gets removed from the final kernel git log.

That information is just for maintainers to remember what was discussed
earlier.  It's not needed for the permanent record.

>  .../staging/rtl8723bs/os_dep/ioctl_linux.c    | 34 +------------------
>  1 file changed, 1 insertion(+), 33 deletions(-)

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-08  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-07 23:20 [PATCH] [v3] staging: rtl8723bs: Clean up dead code Aditya Pakki
2019-01-08  9:57 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®