This idea looks fine to me, but I hate duplicating the logic from SCSI here. Any chance you could try to factor the logic into a common helper? > + struct async_scan_task *task = kzalloc(sizeof(*task), GFP_KERNEL); > + if (!task) Always keep an empty line after function declarations.