diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2023-01-18 15:49:20 +0800 |
---|---|---|
committer | Suzuki K Poulose <suzuki.poulose@arm.com> | 2023-01-19 10:04:44 +0000 |
commit | 075c7c04a81a326a5a28cc0ef8411ba1c5c34e90 (patch) | |
tree | aee90ffc73a949dda52e73cf0cccc08043f8fa61 | |
parent | 2d4103ae31aa6d5570fd1178ddc68867ab4ab5bd (diff) |
coresight: ultrasoc-smb: fix return value check in smb_init_data_buffer()
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
-rw-r--r-- | drivers/hwtracing/coresight/ultrasoc-smb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/ultrasoc-smb.c b/drivers/hwtracing/coresight/ultrasoc-smb.c index 2560fdbb8ebf..b317342c7ce5 100644 --- a/drivers/hwtracing/coresight/ultrasoc-smb.c +++ b/drivers/hwtracing/coresight/ultrasoc-smb.c @@ -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; } |