[PATCH -next] coresight: ultrasoc-smb: fix return value check in smb_init_data_buffer()

Suzuki K Poulose suzuki.poulose at arm.com
Thu Jan 19 02:03:43 PST 2023


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 at 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;
>   	}




More information about the linux-arm-kernel mailing list