1
0
Fork 0

ata: fix return value check in ahci_seattle_get_port_info()

In case of error, the function devm_kzalloc() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
steinar/wifi_calib_4_9_kernel
Wei Yongjun 2016-06-14 00:26:49 +00:00 committed by Tejun Heo
parent db06d759d6
commit f52a4c74ef
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ static const struct ata_port_info *ahci_seattle_get_port_info(
u32 val;
plat_data = devm_kzalloc(dev, sizeof(*plat_data), GFP_KERNEL);
if (IS_ERR(plat_data))
if (!plat_data)
return &ahci_port_info;
plat_data->sgpio_ctrl = devm_ioremap_resource(dev,