diff --git a/drivers/ata/ide-sff.c b/drivers/ata/ide-sff.c index e32cc3f..6dc89d7 100644 --- a/drivers/ata/ide-sff.c +++ b/drivers/ata/ide-sff.c @@ -389,11 +389,10 @@ ide->port.ops = &ide_ops; ret = ata_port_register(&ide->port); - if (!ret) - ata_port_detect(&ide->port); - if (ret) - free(ide); + return ret; - return ret; + ata_port_detect(&ide->port); + + return 0; }