The driver may sleep under a spinlock, and the function call path is:
rtw_set_802_11_bssid(acquire the spinlock)
rtw_disassoc_cmd
kzalloc(GFP_KERNEL) --> may sleep
To fix it, GFP_KERNEL is replaced with GFP_ATOMIC.
This bug is found by my static analysis tool and my code review.
On Sun, 8 Oct 2017, Srishti Sharma wrote:
> The cast to pointer types in kfree is not needed and can be dropped.
> This was done using the following semantic patch by coccinelle,
> except kfree((unsigned char*) pcmd->parmbuf) which was transformed by
> hand because coccinelle didn't have enough
The cast to pointer types in kfree is not needed and can be dropped.
This was done using the following semantic patch by coccinelle,
except kfree((unsigned char*) pcmd->parmbuf) which was transformed by
hand because coccinelle didn't have enough type information.
@r@
type T,P;
T* x;
@@
kfree(
On Sun, 8 Oct 2017, Srishti Sharma wrote:
> Fix the position of the brace after if when it is on the next line.
> Done using the following semantic patch by coccinelle.
>
> @r1@
> position p1, p2;
> @@
>
> if(...)@p1 {@p2
> ...
> }
>
> @script: python r2@
> p1 << r1.p1;
> p2 << r1.p2;
> @@
>
>
On Sun, Oct 8, 2017 at 1:36 AM, Julia Lawall wrote:
>
>
> On Sun, 8 Oct 2017, Srishti Sharma wrote:
>
>> On Sat, Oct 7, 2017 at 11:42 PM, Julia Lawall wrote:
>> >
>> >
>> > On Sat, 7 Oct 2017, Srishti Sharma wrote:
>> >
>> >> The cast to pointer types
On Sun, 8 Oct 2017, Srishti Sharma wrote:
> On Sat, Oct 7, 2017 at 11:42 PM, Julia Lawall wrote:
> >
> >
> > On Sat, 7 Oct 2017, Srishti Sharma wrote:
> >
> >> The cast to pointer types in kfree is not needed and can be dropped.
> >> Done using the following semantic by
On Sat, Oct 7, 2017 at 11:42 PM, Julia Lawall wrote:
>
>
> On Sat, 7 Oct 2017, Srishti Sharma wrote:
>
>> The cast to pointer types in kfree is not needed and can be dropped.
>> Done using the following semantic by coccinelle.
>>
>> @r@
>> type T,P;
>> T* x;
>> @@
>>
>>
Fix the position of the brace after if when it is on the next line.
Done using the following semantic patch by coccinelle.
@r1@
position p1, p2;
@@
if(...)@p1 {@p2
...
}
@script: python r2@
p1 << r1.p1;
p2 << r1.p2;
@@
l1 = int (p1[0].line)
l2 = int (p2[0].line)
c1 = int (p1[0].column_end)
c2
On Sat, 7 Oct 2017, Srishti Sharma wrote:
> The cast to pointer types in kfree is not needed and can be dropped.
> Done using the following semantic by coccinelle.
>
> @r@
> type T,P;
> T* x;
> @@
>
> kfree(
> -(P *)
> x )
>
> Signed-off-by: Srishti Sharma
> ---
>
On Sat, 7 Oct 2017, Srishti Sharma wrote:
> Fix the position of the brace after if when it is on the next line
> or when there is no space between them. Done using the following
> semantic patch by coccinelle.
As far as I can see, in practice, you only move up { from the line below.
There is
On Sat, 7 Oct 2017, Srishti Sharma wrote:
> Use setup_timer to combine initialization of a timer with the
> initialization of the timer's function and data fields. Done
> using the following semantic patch by coccinelle.
>
> @r@
> struct timer_list *l;
> expression f, d;
> @@
>
>
Use setup_timer to combine initialization of a timer with the
initialization of the timer's function and data fields. Done
using the following semantic patch by coccinelle.
@r@
struct timer_list *l;
expression f, d;
@@
-init_timer(l);
+setup_timer(l,f,d);
...
(
- l->function = f;
...
- l->data
Fix the position of the brace after if when it is on the next line
or when there is no space between them. Done using the following
semantic patch by coccinelle.
@r1@
position p1, p2;
identifier x,f;
expression e;
@@
(
x=e;
|
f(...)
)
if(...)@p1 {@p2
...
}
@script: python r2@
p1 << r1.p1;
p2
On Sat, 7 Oct 2017, Srishti Sharma wrote:
> The use of typedefs for struct is discouraged, and hence can be
> eliminated. Done using the following semantic patch by coccinelle.
>
> @r1@
> type T;
> @@
>
> typedef struct {...} T;
>
> @script: python p@
> T << r1.T;
> T1;
> @@
>
> if T[-2:] ==
The use of typedefs for struct is discouraged, and hence can be
eliminated. Done using the following semantic patch by coccinelle.
@r1@
type T;
@@
typedef struct {...} T;
@script: python p@
T << r1.T;
T1;
@@
if T[-2:] == "_t" or T[-2:] == "_T":
coccinelle.T1 = T[:-2]
else:
The cast to pointer types in kfree is not needed and can be dropped.
Done using the following semantic by coccinelle.
@r@
type T,P;
T* x;
@@
kfree(
-(P *)
x )
Signed-off-by: Srishti Sharma
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 58
My name is Huyen Vo Ha. Can I trust you to handle a Business Deal in my
office?. If yes, reply for more understanding.
Regards,
Huyen Vo Ha
AVISO DE SEGURIDAD
~
Los datos contenidos en el mensaje precedente puede tener informacinnn de
17 matches
Mail list logo