Re: [PATCH] staging: rtl8192e: rtl_core: Fix possible null-pointer dereference in _rtl92e_pci_disconnect()

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

 



On Tue, Aug 10, 2021 at 08:11:35PM -0700, Tuo Li wrote:
> The variable dev is checked in:
>   if (dev)
> 
> This indicates that it can be NULL. If so, a null-pointer dereference will 
> occur:
>   priv = rtllib_priv(dev);
> 
> However, the value of priv is not used in the remaining part of this 
> function. Thus the else-branch can be removed to fix this posible 
> null-pointer dereference.
> 
> Reported-by: TOTE Robot <oslab@xxxxxxxxxxxxxxx>
> Signed-off-by: Tuo Li <islituo@xxxxxxxxx>

Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Smatch was not smart enough to spot the dereference inside rtllib_priv().
Fortunately, the "dev" variable can't be NULL at this point.

regards,
dan carpenter





[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