Bug 220236

Summary: sys/dev/dpt/dpt_scsi.c: A possible sleep-under-mutex bug in dpt_init (different from Bug 220095)
Product: Base System Reporter: Jia-Ju Bai <baijiaju1990>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me CC: scsi
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Jia-Ju Bai 2017-06-24 03:09:47 UTC
The driver may sleep under a mutex, and the code path is:
dpt_init [line 1134: acquire the mutex]
  bus_dmamap_tag_create(BUS_DMA_WAITOK) [line 1143] --> may sleep

The possible fix of this bug is to replace the "BUS_DMA_WAITOK" in bus_dmamap_tag_create with "BUS_DMA_NOWAIT".

This bug is found by a static analysis tool written by myself, and it is checked by my review of the FreeBSD code.