Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Yongjun and committed by
Tejun Heo
f52a4c74 db06d759

+1 -1
+1 -1
drivers/ata/ahci_seattle.c
··· 137 137 u32 val; 138 138 139 139 plat_data = devm_kzalloc(dev, sizeof(*plat_data), GFP_KERNEL); 140 - if (IS_ERR(plat_data)) 140 + if (!plat_data) 141 141 return &ahci_port_info; 142 142 143 143 plat_data->sgpio_ctrl = devm_ioremap_resource(dev,