libata: ensure host is free'd on error exit paths
authorColin Ian King <colin.king@canonical.com>
Tue, 27 Mar 2018 13:26:01 +0000 (14:26 +0100)
committerTejun Heo <tj@kernel.org>
Tue, 27 Mar 2018 13:56:02 +0000 (06:56 -0700)
The host structure is not being kfree'd on two error exit paths
leading to memory leaks. Add in new err_free label and kfree host.

Detected by CoverityScan, CID#1466103 ("Resource leak")

Fixes: 2623c7a5f279 ("libata: add refcounting to ata_host")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

No differences found