Commit a25eafd1 authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

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

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

Link: https://lore.kernel.org/r/YnUf7RQl+A3tigWh@kili
Fixes: 4268fa75 ("scsi: mpi3mr: Add bsg device support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 20f8932f
...@@ -1540,7 +1540,7 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc) ...@@ -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), mrioc->bsg_queue = bsg_setup_queue(mrioc->bsg_dev, dev_name(mrioc->bsg_dev),
mpi3mr_bsg_request, NULL, 0); mpi3mr_bsg_request, NULL, 0);
if (!mrioc->bsg_queue) { if (IS_ERR(mrioc->bsg_queue)) {
ioc_err(mrioc, "%s: bsg registration failed\n", ioc_err(mrioc, "%s: bsg registration failed\n",
dev_name(mrioc->bsg_dev)); dev_name(mrioc->bsg_dev));
goto err_setup_queue; goto err_setup_queue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment