summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs/ufs-exynos.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-06-18 13:38:37 +0000
committerMartin K. Petersen <martin.petersen@oracle.com>2020-06-24 00:14:55 -0400
commitb2bc2200e89bf6be01da8a9972fee800891725c0 (patch)
tree6cf33343210d792cbaf750f29ae3119ba9e42941 /drivers/scsi/ufs/ufs-exynos.c
parentd31503fe395d1d7e17b85eb7b291cc1a4bff2671 (diff)
downloadlinux-b2bc2200e89bf6be01da8a9972fee800891725c0.tar.bz2
scsi: ufs: ufs-exynos: Fix return value check in exynos_ufs_init()
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Link: https://lore.kernel.org/r/20200618133837.127274-1-weiyongjun1@huawei.com Fixes: 55f4b1f73631 ("scsi: ufs: ufs-exynos: Add UFS host support for Exynos SoCs") Reported-by: Hulk Robot <hulkci@huawei.com> Acked-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs-exynos.c')
-rw-r--r--drivers/scsi/ufs/ufs-exynos.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index 0a9e99084f2a..16544b3dad47 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -950,25 +950,25 @@ static int exynos_ufs_init(struct ufs_hba *hba)
/* exynos-specific hci */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vs_hci");
ufs->reg_hci = devm_ioremap_resource(dev, res);
- if (!ufs->reg_hci) {
+ if (IS_ERR(ufs->reg_hci)) {
dev_err(dev, "cannot ioremap for hci vendor register\n");
- return -ENOMEM;
+ return PTR_ERR(ufs->reg_hci);
}
/* unipro */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "unipro");
ufs->reg_unipro = devm_ioremap_resource(dev, res);
- if (!ufs->reg_unipro) {
+ if (IS_ERR(ufs->reg_unipro)) {
dev_err(dev, "cannot ioremap for unipro register\n");
- return -ENOMEM;
+ return PTR_ERR(ufs->reg_unipro);
}
/* ufs protector */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ufsp");
ufs->reg_ufsp = devm_ioremap_resource(dev, res);
- if (!ufs->reg_ufsp) {
+ if (IS_ERR(ufs->reg_ufsp)) {
dev_err(dev, "cannot ioremap for ufs protector register\n");
- return -ENOMEM;
+ return PTR_ERR(ufs->reg_ufsp);
}
ret = exynos_ufs_parse_dt(dev, ufs);