mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Smart <jsmart2021@gmail.com>
To: williamsukatube@163.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: james.smart@broadcom.com, dick.kennedy@broadcom.com,
	William Dean <williamsukatube@gmail.com>,
	Hacash Robot <hacashRobot@santino.com>
Subject: Re: [PATCH] scsi: lpfc: check the return value of alloc_workqueue()
Date: Thu, 28 Jul 2022 12:52:10 -0700	[thread overview]
Message-ID: <36eb306c-2e44-4639-5d1a-e1f3e09c3a47@gmail.com> (raw)
In-Reply-To: <20220723064027.2956623-1-williamsukatube@163.com>

On 7/22/2022 11:40 PM, williamsukatube@163.com wrote:
> From: William Dean <williamsukatube@gmail.com>
> 
> The function alloc_workqueue() in lpfc_sli4_driver_resource_setup() can
> fail, but there is no check of its return value. To fix this bug, its
> return value should be checked with new error handling code.
> 
> Fixes: 3cee98db2610f ("scsi: lpfc: Fix crash on driver unload in wq free")
> Reported-by: Hacash Robot <hacashRobot@santino.com>
> Signed-off-by: William Dean <williamsukatube@gmail.com>
> ---
>   drivers/scsi/lpfc/lpfc_init.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 750dd1e9f2cc..8e9594f4ed16 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -7958,6 +7958,8 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
>   
>   	/* The lpfc_wq workqueue for deferred irq use */
>   	phba->wq = alloc_workqueue("lpfc_wq", WQ_MEM_RECLAIM, 0);
> +	if (!phba->wq)
> +		return -ENOMEM;
>   
>   	/*
>   	 * Initialize timers used by driver

Reviewed-by: James Smart <jsmart2021@gmail.com>

-- james

      reply	other threads:[~2022-07-28 19:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-23  6:40 williamsukatube
2022-07-28 19:52 ` James Smart [this message]

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=36eb306c-2e44-4639-5d1a-e1f3e09c3a47@gmail.com \
    --to=jsmart2021@gmail.com \
    --cc=dick.kennedy@broadcom.com \
    --cc=hacashRobot@santino.com \
    --cc=james.smart@broadcom.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=williamsukatube@163.com \
    --cc=williamsukatube@gmail.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

all inboxes | Powered by JetHome®