• Tejun Heo's avatar
    libata: unbreak TPM filtering by reorganizing ata_scsi_pass_thru() · bd30add8
    Tejun Heo authored
    ata_scsi_pass_thru() was checking for input sanity and disallowed
    commands while initializaing qc from scmd.  TPM filtering was added
    right after protocol check at which point tf wasn't initialized
    properly.  This means that TPM filtering has never really worked.
    
    This patch fixes the bug by reorganizing ata_scsi_pass_thru() such
    that qc is fully initialized before checking for invalid conditions
    which is way less error prone.
    
    Discovered while Thilo-Alexander Ginkel was trying debug patches for
    bko#13416.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Thilo-Alexander Ginkel <thilo@ginkel.com>
    Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
    bd30add8
libata-scsi.c 93.6 KB