From: Yang Yingliang Date: Wed, 18 Jan 2023 07:49:20 +0000 (+0800) Subject: coresight: ultrasoc-smb: fix return value check in smb_init_data_buffer() X-Git-Tag: v6.6.7~3435^2~32^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=075c7c04a81a326a5a28cc0ef8411ba1c5c34e90;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230118074920.1772141-1-yangyingliang@huawei.com --- 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; }