• Jia-Ju Bai's avatar
    scsi: st: Replace GFP_ATOMIC with GFP_KERNEL in new_tape_buffer · 4011f076
    Jia-Ju Bai authored
    new_tape_buffer() is never called in atomic context. new_tape_buffer()
    is only called by st_probe(), which is only set as ".probe" in struct
    scsi_driver.
    
    Despite never getting called from atomic context, new_tape_buffer()
    calls kzalloc() with GFP_ATOMIC, which does not sleep for allocation.
    GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, which
    can sleep and improve the possibility of sucessful allocation.
    
    This is found by a static analysis tool named DCNS written by myself.
    And I also manually check it.
    Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    4011f076
st.c 130 KB