Re: [bug report] scsi: megaraid: Pass in NULL scb for host reset

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

 



On 10/17/23 15:56, Dan Carpenter wrote:
Hello Hannes Reinecke,

The patch 5bcd3bfbda02: "scsi: megaraid: Pass in NULL scb for host
reset" from Oct 2, 2023 (linux-next), leads to the following Smatch
static checker warning:

     drivers/scsi/megaraid.c:1901 megaraid_reset()
     error: NULL dereference inside function 'megaraid_abort_and_reset()'

     drivers/scsi/megaraid.c:1940 megaraid_abort_and_reset()
     warn: variable dereferenced before check 'cmd' (see line 1928)

drivers/scsi/megaraid.c
     1899         spin_lock_irq(&adapter->lock);
     1900
--> 1901         rval =  megaraid_abort_and_reset(adapter, NULL, SCB_RESET);
                                                            ^^^^
The debug code dereferences this unconditionally...

     1902
     1903         /*
     1904          * This is required here to complete any completed requests
     1905          * to be communicated over to the mid layer.
     1906          */
     1907         mega_rundoneq(adapter);
     1908         spin_unlock_irq(&adapter->lock);
     1909
     1910         return rval;
     1911 }

Will be sending a patch.

Cheers,

Hannes





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux