• T
    [PATCH] libata: fix ata_device_add() error path · 77f3f879
    Tejun Heo 提交于
    In the error path, ata_device_add()
    
    * dereferences null host_set->ports[] element.
    * calls scsi_remove_host() on not-yet-added shost.
    
    This patch fixes both bugs.  The first problem was spotted and initial
    patch submitted by Dave Jones <davej@redhat.com>.  The second problem
    was mentioned and fixed by Jeff Garzik <jgarzik@pobox.com> in a larger
    cleanup patch.
    
    Cc: Dave Jones <davej@redhat.com>
    Cc: Jeff Garzik <jgarzik@pobox.com>
    Signed-off-by: NTejun Heo <htejun@gmail.com>
    77f3f879
libata-core.c 144.5 KB