• Damien Le Moal's avatar
    ata: libata: Improve __ata_qc_complete() · 5bb52d92
    Damien Le Moal authored
    The function __ata_qc_complete() is always called with a qc that already
    has been dereferenced and so is guaranteed to be non-NULL (as otherwise
    the kernel would have crashed). So remove the warning for a NULL qc as
    it is useless.
    
    Furthermore, the qc passed to __ata_qc_complete() must always be marked
    as active with the ATA_QCFLAG_ACTIVE flag. If that is not the case, in
    addition to the existing warning, return early so that we do not attempt
    to complete an invalid qc.
    
    Finally, fix the comment related to clearing the qc active flag as that
    operation applies to all devices, not just ATAPI ones.
    Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
    Reviewed-by: default avatarNiklas Cassel <cassel@kernel.org>
    Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
    5bb52d92
libata-core.c 172 KB