Skip to content

Commit

Permalink
ata: fix return value check in ahci_seattle_get_port_info()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and htejun committed Jun 15, 2016
1 parent db06d75 commit f52a4c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/ahci_seattle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f52a4c7

Please sign in to comment.