Message ID | 20230118074920.1772141-1-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [-next] coresight: ultrasoc-smb: fix return value check in smb_init_data_buffer() | expand |
On 18/01/2023 07:49, Yang Yingliang wrote: > platform_get_resource() returns NULL pointer not PTR_ERR(), replace > the IS_ERR() check with NULL pointer check. > > Fixes: 06f5c2926aaa ("drivers/coresight: Add UltraSoc System Memory Buffer driver") We cannot use a Fixes tag on a commit that is not in Linus's tree. I will queue this without the tag. Thanks Suzuki > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> > --- > drivers/hwtracing/coresight/ultrasoc-smb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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; > }
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; }
platform_get_resource() returns NULL pointer not PTR_ERR(), replace the IS_ERR() check with NULL pointer check. Fixes: 06f5c2926aaa ("drivers/coresight: Add UltraSoc System Memory Buffer driver") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- drivers/hwtracing/coresight/ultrasoc-smb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)