From: Dan Carpenter Date: Fri, 6 May 2022 13:17:33 +0000 (+0300) Subject: scsi: mpi3mr: Fix a NULL vs IS_ERR() bug in mpi3mr_bsg_init() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a25eafd13e5f79d9bbada5a4a4a4224cc5f6d14c;p=users%2Fhch%2Fuuid.git 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: 4268fa751365 ("scsi: mpi3mr: Add bsg device support") Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen --- 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;