ata: fix return value check in ahci_seattle_get_port_info()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 14 Jun 2016 00:26:49 +0000 (00:26 +0000)
committerTejun Heo <tj@kernel.org>
Wed, 15 Jun 2016 18:26:41 +0000 (14:26 -0400)
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>
drivers/ata/ahci_seattle.c

index 6e702ab572204deb87d96c0bd399b42d42f2a1f0..1d31c0c0fc20b48c287d2df293776cf9c1e52329 100644 (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,
This page took 0.028876 seconds and 5 git commands to generate.