ata: ide-sff: don't call free for ide_port in error path
The ide_port is provided by the caller so it's not in the responsibility of this function to free this memory in case of error. Actually all callers do the free themselves, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
731909c0b4
commit
55d2952514
|
@ -389,11 +389,10 @@ int ide_port_register(struct ide_port *ide)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue