Files
Shao Mingyin 46846939d5 scsi: rdac: Keep the error status when controller lookup fails
initialize_controller() records SCSI_DH_RES_TEMP_UNAVAIL when
get_controller() fails, but then overwrites it with SCSI_DH_OK
unconditionally. It therefore reports success with h->ctlr == NULL and
rdac_bus_attach() continues with check_ownership(), which dereferences
h->ctlr:

  BUG: kernel NULL pointer dereference, address: 0000000000000000
  ...
  check_ownership
  rdac_bus_attach

get_controller() only fails when its GFP_ATOMIC allocation fails, so the
crash happens exactly when memory is already scarce.

Only report success after the controller was found and the device was added
to its list.

Fixes: 3278255741 ("scsi_dh_rdac: switch to scsi_execute_req_flags()")
Signed-off-by: Shao Mingyin <[email protected]>
Cc: [email protected]
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Martin K. Petersen (Oracle) <[email protected]>
2026-11-08 21:20:31 -05:00
..
2026-08-13 22:04:50 -04:00