lkml.org 
[lkml]   [2022]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: nvme-pci: NULL pointer dereference in nvme_dev_disable() on linux-next
From

> Below is the minimal fix. I'll see if I sort out the mess that is
> probe/reset failure vs ->remove a bit better, though.
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index f94b05c585cbc..577bacdcfee08 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -5160,6 +5160,8 @@ EXPORT_SYMBOL_GPL(nvme_start_freeze);
>
> void nvme_stop_queues(struct nvme_ctrl *ctrl)
> {
> + if (!ctrl->tagset)
> + return;
> if (!test_and_set_bit(NVME_CTRL_STOPPED, &ctrl->flags))
> blk_mq_quiesce_tagset(ctrl->tagset);
> else
> @@ -5169,6 +5171,8 @@ EXPORT_SYMBOL_GPL(nvme_stop_queues);
>
> void nvme_start_queues(struct nvme_ctrl *ctrl)
> {
> + if (!ctrl->tagset)
> + return;
> if (test_and_clear_bit(NVME_CTRL_STOPPED, &ctrl->flags))
> blk_mq_unquiesce_tagset(ctrl->tagset);
> }

Can we do that in the pci driver and not here?

\
 
 \ /
  Last update: 2022-11-09 03:54    [W:1.976 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site