cam: Check if cam_simq_alloc fails for the xpt bus during module init

This is very unlikely to fail (and if it does, CAM isn't going to work
regardless), but fail with an error rather than a gauranteed panic via
NULL pointer dereference.

PR:		276770
Reported by:	Qiushi <w290680224@gmail.com>
This commit is contained in:
John Baldwin
2024-02-09 11:53:43 -08:00
parent b377ff8110
commit eb86c6c5b4
+2
View File
@@ -908,6 +908,8 @@ xpt_init(void *dummy)
* perform other XPT functions.
*/
devq = cam_simq_alloc(16);
if (devq == NULL)
return (ENOMEM);
xpt_sim = cam_sim_alloc(xptaction,
xptpoll,
"xpt",