From: Bart Van Assche <bvanassche@acm.org>
To: Guixin Liu <kanie@linux.alibaba.com>,
Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>,
Kashyap Desai <kashyap.desai@broadcom.com>,
Sumit Saxena <sumit.saxena@broadcom.com>,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: mpi3mr-linuxdrv.pdl@broadcom.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH v3] scsi: mpi3mr: fix possible crash when setup bsg fail
Date: Mon, 6 Jan 2025 10:30:25 -0800 [thread overview]
Message-ID: <3e87b69b-38aa-413f-a2bf-388da21afaa0@acm.org> (raw)
In-Reply-To: <20241226121808.46396-1-kanie@linux.alibaba.com>
On 12/26/24 4:18 AM, Guixin Liu wrote:
> diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
> index 10b8e4dc64f8..7589f48aebc8 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr_app.c
> +++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
> @@ -2951,6 +2951,7 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc)
> .max_hw_sectors = MPI3MR_MAX_APP_XFER_SECTORS,
> .max_segments = MPI3MR_MAX_APP_XFER_SEGMENTS,
> };
> + struct request_queue *q;
>
> device_initialize(bsg_dev);
>
> @@ -2966,14 +2967,17 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc)
> return;
> }
>
> - mrioc->bsg_queue = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), &lim,
> + q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), &lim,
> mpi3mr_bsg_request, NULL, 0);
> - if (IS_ERR(mrioc->bsg_queue)) {
> + if (IS_ERR(q)) {
> ioc_err(mrioc, "%s: bsg registration failed\n",
> dev_name(bsg_dev));
> device_del(bsg_dev);
> put_device(bsg_dev);
> + return;
> }
> +
> + mrioc->bsg_queue = q;
> }
Next time, when including a call stack in the patch description, please
clean it up. This means removing the timestamps, the register dumps and
also the stack frames that start with " ? ". Anyway:
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
next prev parent reply other threads:[~2025-01-06 18:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-26 12:18 [PATCH v3] scsi: mpi3mr: fix possible crash when setup bsg fail Guixin Liu
2024-12-30 1:33 ` Guixin Liu
2025-01-06 18:30 ` Bart Van Assche [this message]
2025-01-07 2:04 ` Guixin Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e87b69b-38aa-413f-a2bf-388da21afaa0@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=kanie@linux.alibaba.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mpi3mr-linuxdrv.pdl@broadcom.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=sumit.saxena@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox