summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2016-06-14 02:26:49 +0200
committerTejun Heo <tj@kernel.org>2016-06-15 20:26:41 +0200
commitf52a4c74efbb61195490535e9d65d964c4ebfee3 (patch)
treec10ce11ac682d4f76858c3b1a4f95070adc82682 /drivers/ata
parentMerge branch 'for-4.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff)
downloadlinux-f52a4c74efbb61195490535e9d65d964c4ebfee3.tar.xz
linux-f52a4c74efbb61195490535e9d65d964c4ebfee3.zip
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>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/ahci_seattle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/ahci_seattle.c b/drivers/ata/ahci_seattle.c
index 6e702ab57220..1d31c0c0fc20 100644
--- a/drivers/ata/ahci_seattle.c
+++ b/drivers/ata/ahci_seattle.c
@@ -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,