diff mbox series

scsi: mpi3mr: Fix a NULL vs IS_ERR() bug in mpi3mr_bsg_init()

Message ID YnUf7RQl+A3tigWh@kili (mailing list archive)
State Accepted
Headers show
Series scsi: mpi3mr: Fix a NULL vs IS_ERR() bug in mpi3mr_bsg_init() | expand

Commit Message

Dan Carpenter May 6, 2022, 1:17 p.m. UTC
The bsg_setup_queue() function does not return NULL.  It returns
error pointers.  Fix the check accordingly.

Fixes: 4268fa751365 ("scsi: mpi3mr: Add bsg device support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/mpi3mr/mpi3mr_app.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen May 17, 2022, 1:31 a.m. UTC | #1
Dan,

> The bsg_setup_queue() function does not return NULL.  It returns error
> pointers.  Fix the check accordingly.

Applied to 5.19/scsi-staging, thanks!
Martin K. Petersen May 20, 2022, 1:09 a.m. UTC | #2
On Fri, 6 May 2022 16:17:33 +0300, Dan Carpenter wrote:

> The bsg_setup_queue() function does not return NULL.  It returns
> error pointers.  Fix the check accordingly.
> 
> 

Applied to 5.19/scsi-queue, thanks!

[1/1] scsi: mpi3mr: Fix a NULL vs IS_ERR() bug in mpi3mr_bsg_init()
      https://git.kernel.org/mkp/scsi/c/a25eafd13e5f
diff mbox series

Patch

diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index 73bb7992d5a8..8138a728d1ab 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -1540,7 +1540,7 @@  void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc)
 
 	mrioc->bsg_queue = bsg_setup_queue(mrioc->bsg_dev, dev_name(mrioc->bsg_dev),
 			mpi3mr_bsg_request, NULL, 0);
-	if (!mrioc->bsg_queue) {
+	if (IS_ERR(mrioc->bsg_queue)) {
 		ioc_err(mrioc, "%s: bsg registration failed\n",
 		    dev_name(mrioc->bsg_dev));
 		goto err_setup_queue;