On Tue, Aug 30, 2011 at 11:53:06AM -0500, Larry Finger wrote: > Smatch outputs the following warning: > > CHECK drivers/staging/rtl8192e/rtl819x_BAProc.c > drivers/staging/rtl8192e/rtl819x_BAProc.c +88 rtllib_ADDBA(12) warn: variable dereferenced before check 'ieee' > > Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx> > --- > drivers/staging/rtl8192e/rtl819x_BAProc.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c > index 48f9f71..914bdcd 100644 > --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c > +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c > @@ -81,7 +81,11 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, > struct rtllib_hdr_3addr *BAReq = NULL; > u8 *tag = NULL; > u16 tmp = 0; > - u16 len = ieee->tx_headroom + 9; > + u16 len; > + > + if (!ieee) > + return NULL; There is a second check for NULL later in the function that can be removed as well. > + len = ieee->tx_headroom + 9; > RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "========>%s(), frame(%d)" > " sentd to: %pM, ieee->dev:%p\n", __func__, > type, Dst, ieee->dev); regards, dan carpenter _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel