浏览代码

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>
Wei Yongjun 9 年之前
父节点
当前提交
f52a4c74ef
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/ata/ahci_seattle.c

+ 1 - 1
drivers/ata/ahci_seattle.c

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