Re: [PATCH 3/6] staging: r8188eu: cnt is set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thus wrote Pavel Skripkin (paskripkin@xxxxxxxxx):

> On 2/26/22 19:57, Pavel Skripkin wrote:
> > Hi Martin,

> > On 2/26/22 17:48, Martin Kaiser wrote:
> > > In function recv_func, the cnt variable is set but not used.
> > > It can be removed.

> > > Signed-off-by: Martin Kaiser <martin@xxxxxxxxx>
> > > ---
> > >   drivers/staging/r8188eu/core/rtw_recv.c | 2 --
> > >   1 file changed, 2 deletions(-)

> > > diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
> > > index 0144c4642911..9a2e2bc2e294 100644
> > > --- a/drivers/staging/r8188eu/core/rtw_recv.c
> > > +++ b/drivers/staging/r8188eu/core/rtw_recv.c
> > > @@ -1798,11 +1798,9 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe)
> > >   	if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
> > >   	    psecuritypriv->busetkipkey) {
> > >   		struct recv_frame *pending_frame;
> > > -		int cnt = 0;
> > >   		pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue);
> > >   		while (pending_frame) {

> > Just out of curiosity: is this thing infinity loop?


> Hm.

> This function is called only inside a tasklet. IIRC it's not ok to have this
> kind of loops in softirq context

What exactly is this doing that's not allowed in a tasklet? Does it call
anything that could potentially block? 

If I pull rtw_alloc_recvframe into the loop, that function uses spin_lock_bh +
spin_unlock_bh, I guess this is ok. As for recv_func_posthandle, I don't
see anything where we could be stuck...

Thanks,
Martin




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux