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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user