mpi3mr: rework mrioc->bsg_device model to fix up smatch warnings
Subsystems (2)
Sumit Saxena
maintainerPATCH 1/1 mpi3mr: rework mrioc->bsg_device model to fix up smatch warnings
During driver unload, "mrioc->bsg_device" reference count becomes negative. Also, as reported in [1], driver's bsg_device model had few more bugs so reworked it to fix up them.
[1] https://marc.info/?l=linux-scsi&m=165183971411991&w=2
--- drivers/scsi/mpi3mr/mpi3mr.h | 2 +- drivers/scsi/mpi3mr/mpi3mr_app.c | 48 +++++++++++++++----------------- 2 files changed, 23 insertions(+), 27 deletions(-)
drivers/scsi/mpi3mr/mpi3mr.h +1 -1
@@ -954,7 +954,7 @@ struct mpi3mr_ioc {u16 active_poll_qcount;u16 requested_poll_qcount; -struct device *bsg_dev; +struct device bsg_dev;struct request_queue *bsg_queue;u8 stop_bsgs;u8 *logdata_buf;
drivers/scsi/mpi3mr/mpi3mr_app.c +22 -26
91 lines not on this page · raw message
Signature · 1 line
2.27.0
Quoted 9 lines · Sumit Saxena
During driver unload, "
mrioc->bsg_device" reference count becomes negative. Also, as reported in [1], driver'sbsg_devicemodel had few more bugs so reworked it to fix up them.[1] https://marc.info/?l=linux-scsi&m=165183971411991&w=2
Fixes 4268fa751365 ("scsi: mpi3mr: Add bsg device support")Reported-by Dan Carpenter <[email protected]>Signed-off-by Sumit Saxena <[email protected]>
I've been seeing the issue when rmmod the driver, with this patch it's gone.
Martin K. Petersen
AppliedSumit,
Quoted 3 lines
During driver unload, "
mrioc->bsg_device" reference count becomes negative. Also, as reported in [1], driver'sbsg_devicemodel had few more bugs so reworked it to fix up them.
Applied to 5.19/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering