Skip to contentSkip to conversation

mpi3mr: rework mrioc->bsg_device model to fix up smatch warnings

PATCH Applied Sumit Saxena 3 participants 3 messages May 26, 2022 – Jun 2, 2022

Subsystems (2)
lore
Share & tools
lore

Sumit Saxena

author maintainer
#0 lore raw

PATCH 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

Fixes 4268fa751365 ("scsi: mpi3mr: Add bsg device support")
---
 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
index 01cd01787b0f..0e1cb4aa4ca2 100644
@@ -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
Tested-by on v1 1/1
#1 lore raw
Quoted 9 lines · Sumit Saxena

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

Fixes 4268fa751365 ("scsi: mpi3mr: Add bsg device support")

I've been seeing the issue when rmmod the driver, with this patch it's gone.

#2 lore raw
In reply to Sumit Saxena

Sumit,

Quoted 3 lines

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.

Applied to 5.19/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering