coresight: ultrasoc-smb: fix return value check in smb_init_data_buffer()
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 18 Jan 2023 07:49:20 +0000 (15:49 +0800)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Thu, 19 Jan 2023 10:04:44 +0000 (10:04 +0000)
platform_get_resource() returns NULL pointer not PTR_ERR(), replace
the IS_ERR() check with NULL pointer check.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230118074920.1772141-1-yangyingliang@huawei.com
drivers/hwtracing/coresight/ultrasoc-smb.c

index 2560fdbb8ebf37f481f08d4e08d30080e387577a..b317342c7ce5a55f68f2d2b2aebed9c884f09716 100644 (file)
@@ -455,7 +455,7 @@ static int smb_init_data_buffer(struct platform_device *pdev,
        void *base;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, SMB_BUF_ADDR_RES);
-       if (IS_ERR(res)) {
+       if (!res) {
                dev_err(&pdev->dev, "SMB device failed to get resource\n");
                return -EINVAL;
        }