* [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Fix for possible null pointer dereference
@ 2014-12-14 22:39 Rickard Strandqvist
2014-12-15 10:31 ` Dan Carpenter
0 siblings, 1 reply; 6+ messages in thread
From: Rickard Strandqvist @ 2014-12-14 22:39 UTC (permalink / raw)
To: Larry Finger, Jes Sorensen
Cc: Rickard Strandqvist, Greg Kroah-Hartman, linux-wireless, devel,
linux-kernel
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/staging/rtl8723au/os_dep/usb_intf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c b/drivers/staging/rtl8723au/os_dep/usb_intf.c
index 865743e..71a6330 100644
--- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
@@ -351,10 +351,11 @@ error_exit:
int rtw_hw_resume23a(struct rtw_adapter *padapter)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
- struct net_device *pnetdev = padapter->pnetdev;
+ struct net_device *pnetdev;
if (padapter) { /* system resume */
DBG_8723A("==> rtw_hw_resume23a\n");
+ pnetdev = padapter->pnetdev;
down(&pwrpriv->lock);
pwrpriv->bips_processing = true;
rtw_reset_drv_sw23a(padapter);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Fix for possible null pointer dereference
2014-12-14 22:39 [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Fix for possible null pointer dereference Rickard Strandqvist
@ 2014-12-15 10:31 ` Dan Carpenter
2014-12-15 15:48 ` Jes Sorensen
0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2014-12-15 10:31 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Larry Finger, Jes Sorensen, devel, Greg Kroah-Hartman,
linux-wireless, linux-kernel
On Sun, Dec 14, 2014 at 11:39:14PM +0100, Rickard Strandqvist wrote:
> There is otherwise a risk of a possible null pointer dereference.
>
> Was largely found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
> drivers/staging/rtl8723au/os_dep/usb_intf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c b/drivers/staging/rtl8723au/os_dep/usb_intf.c
> index 865743e..71a6330 100644
> --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
> +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
> @@ -351,10 +351,11 @@ error_exit:
> int rtw_hw_resume23a(struct rtw_adapter *padapter)
That's weird. Is this function even called?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Fix for possible null pointer dereference
2014-12-15 10:31 ` Dan Carpenter
@ 2014-12-15 15:48 ` Jes Sorensen
2014-12-15 23:01 ` Rickard Strandqvist
0 siblings, 1 reply; 6+ messages in thread
From: Jes Sorensen @ 2014-12-15 15:48 UTC (permalink / raw)
To: Dan Carpenter
Cc: Rickard Strandqvist, Larry Finger, devel, Greg Kroah-Hartman,
linux-wireless, linux-kernel
Dan Carpenter <dan.carpenter@oracle.com> writes:
> On Sun, Dec 14, 2014 at 11:39:14PM +0100, Rickard Strandqvist wrote:
>> There is otherwise a risk of a possible null pointer dereference.
>>
>> Was largely found by using a static code analysis program called cppcheck.
>>
>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>> ---
>> drivers/staging/rtl8723au/os_dep/usb_intf.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c
>> b/drivers/staging/rtl8723au/os_dep/usb_intf.c
>> index 865743e..71a6330 100644
>> --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
>> +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
>> @@ -351,10 +351,11 @@ error_exit:
>> int rtw_hw_resume23a(struct rtw_adapter *padapter)
>
> That's weird. Is this function even called?
[jes@ultrasam jes.git]$ find drivers/staging/rtl8723au -name \*.[ch] |xargs grep rtw_hw_resume
drivers/staging/rtl8723au/include/osdep_intf.h:int rtw_hw_resume23a(struct rtw_adapter *padapter);
drivers/staging/rtl8723au/os_dep/usb_intf.c:int rtw_hw_resume23a(struct rtw_adapter *padapter)
drivers/staging/rtl8723au/os_dep/usb_intf.c: DBG_8723A("==> rtw_hw_resume23a\n");
[jes@ultrasam jes.git]$ find drivers/staging/rtl8723au -name \*.[ch] |xargs grep rtw_hw_suspend
drivers/staging/rtl8723au/include/osdep_intf.h:int rtw_hw_suspend23a(struct rtw_adapter *padapter);
drivers/staging/rtl8723au/os_dep/usb_intf.c:int rtw_hw_suspend23a(struct rtw_adapter *padapter)
drivers/staging/rtl8723au/os_dep/usb_intf.c: DBG_8723A("==> rtw_hw_suspend23a\n");
A more useful patch would be one removing those two functions IMHO.
Jes
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Fix for possible null pointer dereference
2014-12-15 15:48 ` Jes Sorensen
@ 2014-12-15 23:01 ` Rickard Strandqvist
2014-12-16 0:04 ` Larry Finger
0 siblings, 1 reply; 6+ messages in thread
From: Rickard Strandqvist @ 2014-12-15 23:01 UTC (permalink / raw)
To: Jes Sorensen
Cc: Dan Carpenter, Larry Finger, devel, Greg Kroah-Hartman,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Hi
No the rtw_hw_resume23a() is not used anywhere.
I also do a check of all functions that are not used, but not in the
drivers/staging, I suspected that these might be under development and
used in the future.
What do you want to do, who decides?
Kind regards
Rickard Strandqvist
2014-12-15 16:48 GMT+01:00 Jes Sorensen <Jes.Sorensen@redhat.com>:
> Dan Carpenter <dan.carpenter@oracle.com> writes:
>> On Sun, Dec 14, 2014 at 11:39:14PM +0100, Rickard Strandqvist wrote:
>>> There is otherwise a risk of a possible null pointer dereference.
>>>
>>> Was largely found by using a static code analysis program called cppcheck.
>>>
>>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>>> ---
>>> drivers/staging/rtl8723au/os_dep/usb_intf.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c
>>> b/drivers/staging/rtl8723au/os_dep/usb_intf.c
>>> index 865743e..71a6330 100644
>>> --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
>>> +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
>>> @@ -351,10 +351,11 @@ error_exit:
>>> int rtw_hw_resume23a(struct rtw_adapter *padapter)
>>
>> That's weird. Is this function even called?
>
> [jes@ultrasam jes.git]$ find drivers/staging/rtl8723au -name \*.[ch] |xargs grep rtw_hw_resume
> drivers/staging/rtl8723au/include/osdep_intf.h:int rtw_hw_resume23a(struct rtw_adapter *padapter);
> drivers/staging/rtl8723au/os_dep/usb_intf.c:int rtw_hw_resume23a(struct rtw_adapter *padapter)
> drivers/staging/rtl8723au/os_dep/usb_intf.c: DBG_8723A("==> rtw_hw_resume23a\n");
> [jes@ultrasam jes.git]$ find drivers/staging/rtl8723au -name \*.[ch] |xargs grep rtw_hw_suspend
> drivers/staging/rtl8723au/include/osdep_intf.h:int rtw_hw_suspend23a(struct rtw_adapter *padapter);
> drivers/staging/rtl8723au/os_dep/usb_intf.c:int rtw_hw_suspend23a(struct rtw_adapter *padapter)
> drivers/staging/rtl8723au/os_dep/usb_intf.c: DBG_8723A("==> rtw_hw_suspend23a\n");
>
> A more useful patch would be one removing those two functions IMHO.
>
> Jes
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Fix for possible null pointer dereference
2014-12-15 23:01 ` Rickard Strandqvist
@ 2014-12-16 0:04 ` Larry Finger
2014-12-17 20:06 ` Rickard Strandqvist
0 siblings, 1 reply; 6+ messages in thread
From: Larry Finger @ 2014-12-16 0:04 UTC (permalink / raw)
To: Rickard Strandqvist, Jes Sorensen
Cc: Dan Carpenter, devel, Greg Kroah-Hartman,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
On 12/15/2014 05:01 PM, Rickard Strandqvist wrote:
> Hi
>
> No the rtw_hw_resume23a() is not used anywhere.
> I also do a check of all functions that are not used, but not in the
> drivers/staging, I suspected that these might be under development and
> used in the future.
>
> What do you want to do, who decides?
The original developers of this code do not include any of the Linux
maintainers. If you see an unused routine, submit a patch to delete it. If a
maintainer thinks it should be kept, your patch will be NACKed, but that is pnot
likely.
Larry
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Fix for possible null pointer dereference
2014-12-16 0:04 ` Larry Finger
@ 2014-12-17 20:06 ` Rickard Strandqvist
0 siblings, 0 replies; 6+ messages in thread
From: Rickard Strandqvist @ 2014-12-17 20:06 UTC (permalink / raw)
To: Larry Finger
Cc: Jes Sorensen, Dan Carpenter, devel, Greg Kroah-Hartman,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Hi
Ok, do a patch to remove it now.
Kind regards
Rickard Strandqvist
2014-12-16 1:04 GMT+01:00 Larry Finger <Larry.Finger@lwfinger.net>:
> On 12/15/2014 05:01 PM, Rickard Strandqvist wrote:
>>
>> Hi
>>
>> No the rtw_hw_resume23a() is not used anywhere.
>> I also do a check of all functions that are not used, but not in the
>> drivers/staging, I suspected that these might be under development and
>> used in the future.
>>
>> What do you want to do, who decides?
>
>
> The original developers of this code do not include any of the Linux
> maintainers. If you see an unused routine, submit a patch to delete it. If a
> maintainer thinks it should be kept, your patch will be NACKed, but that is
> pnot likely.
>
> Larry
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-12-17 20:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-14 22:39 [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Fix for possible null pointer dereference Rickard Strandqvist
2014-12-15 10:31 ` Dan Carpenter
2014-12-15 15:48 ` Jes Sorensen
2014-12-15 23:01 ` Rickard Strandqvist
2014-12-16 0:04 ` Larry Finger
2014-12-17 20:06 ` Rickard Strandqvist
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).