lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250424030227.3505997-1-haoxiang_li2024@163.com>
Date: Thu, 24 Apr 2025 11:02:27 +0800
From: Haoxiang Li <haoxiang_li2024@....com>
To: linuxdrivers@...otech.com,
	James.Bottomley@...senPartnership.com,
	martin.petersen@...cle.com,
	bvanassche@....org
Cc: linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Haoxiang Li <haoxiang_li2024@....com>,
	stable@...r.kernel.org
Subject: [PATCH RESEND] scsi: esas2r: Add check for alloc_ordered_workqueue()

Add check for the return value of alloc_ordered_workqueue()
in esas2r_init_adapter() to catch potential exception.

Fixes: 4cb1b41a5ee4 ("scsi: esas2r: Simplify an alloc_ordered_workqueue() invocation")
Cc: stable@...r.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@....com>
---
 drivers/scsi/esas2r/esas2r_init.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c
index 04a07fe57be2..9c0225a1f208 100644
--- a/drivers/scsi/esas2r/esas2r_init.c
+++ b/drivers/scsi/esas2r/esas2r_init.c
@@ -313,6 +313,11 @@ int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid,
 	esas2r_fw_event_off(a);
 	a->fw_event_q =
 		alloc_ordered_workqueue("esas2r/%d", WQ_MEM_RECLAIM, a->index);
+	if (!a->fw_event_q) {
+		esas2r_log(ESAS2R_LOG_CRIT, "failed to create work queue\n");
+		esas2r_kill_adapter(index);
+		return 0;
+	}
 
 	init_waitqueue_head(&a->buffered_ioctl_waiter);
 	init_waitqueue_head(&a->nvram_waiter);
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ