]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Fix panic when FW-log buffsize is not initialized
authorJames Smart <jsmart2021@gmail.com>
Fri, 30 Nov 2018 00:09:27 +0000 (16:09 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 8 Dec 2018 03:35:31 +0000 (22:35 -0500)
commitc22f9cd707a4023fd8c27e845f36bfed5b087a7f
treeb290202cd883f811e3242d8bd400fdfeb3be160b
parent5916c26df77377b5c954d3d8e581434e9bc3a682
scsi: lpfc: Fix panic when FW-log buffsize is not initialized

While trying to get adapter fw-log for a function whose buffsize was set to
0, kernel panic occurred.

When buffsize is 0, the kernel buffer for the log won't be allocated.  When
fw log usage was enabled, it failed to check the buffer size, and log usage
was started. Eventually the driver referenced the unallocated log buffer.

Added checks of the buffer size before allowing fw logging to be enabled
and added check for valid buffer if enabling fw log.

Performed a couple other minor cleanups while fixing this:
 - clarified log messages
 - re-evaluated log message severity
 - treat any error as an error, not only a couple codes

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_bsg.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_sli.c