* [PATCH -next] xen-pciback: Fix return in pm_ctrl_init()
@ 2021-10-08 7:44 YueHaibing
2021-10-08 15:01 ` Juergen Gross
0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2021-10-08 7:44 UTC (permalink / raw)
To: boris.ostrovsky, jgross, sstabellini; +Cc: xen-devel, linux-kernel, YueHaibing
Return NULL instead of passing to ERR_PTR while err is zero,
this fix smatch warnings:
drivers/xen/xen-pciback/conf_space_capability.c:163
pm_ctrl_init() warn: passing zero to 'ERR_PTR'
Fixes: a92336a1176b ("xen/pciback: Drop two backends, squash and cleanup some code.")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/xen/xen-pciback/conf_space_capability.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/xen/xen-pciback/conf_space_capability.c b/drivers/xen/xen-pciback/conf_space_capability.c
index 22f13abbe913..5e53b4817f16 100644
--- a/drivers/xen/xen-pciback/conf_space_capability.c
+++ b/drivers/xen/xen-pciback/conf_space_capability.c
@@ -160,7 +160,7 @@ static void *pm_ctrl_init(struct pci_dev *dev, int offset)
}
out:
- return ERR_PTR(err);
+ return err ? ERR_PTR(err) : NULL;
}
static const struct config_field caplist_pm[] = {
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] xen-pciback: Fix return in pm_ctrl_init()
2021-10-08 7:44 [PATCH -next] xen-pciback: Fix return in pm_ctrl_init() YueHaibing
@ 2021-10-08 15:01 ` Juergen Gross
2021-10-27 13:18 ` Boris Ostrovsky
0 siblings, 1 reply; 3+ messages in thread
From: Juergen Gross @ 2021-10-08 15:01 UTC (permalink / raw)
To: YueHaibing, boris.ostrovsky, sstabellini; +Cc: xen-devel, linux-kernel
[-- Attachment #1.1.1: Type: text/plain, Size: 445 bytes --]
On 08.10.21 09:44, YueHaibing wrote:
> Return NULL instead of passing to ERR_PTR while err is zero,
> this fix smatch warnings:
> drivers/xen/xen-pciback/conf_space_capability.c:163
> pm_ctrl_init() warn: passing zero to 'ERR_PTR'
>
> Fixes: a92336a1176b ("xen/pciback: Drop two backends, squash and cleanup some code.")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] xen-pciback: Fix return in pm_ctrl_init()
2021-10-08 15:01 ` Juergen Gross
@ 2021-10-27 13:18 ` Boris Ostrovsky
0 siblings, 0 replies; 3+ messages in thread
From: Boris Ostrovsky @ 2021-10-27 13:18 UTC (permalink / raw)
To: Juergen Gross, YueHaibing, sstabellini; +Cc: xen-devel, linux-kernel
On 10/8/21 11:01 AM, Juergen Gross wrote:
> On 08.10.21 09:44, YueHaibing wrote:
>> Return NULL instead of passing to ERR_PTR while err is zero,
>> this fix smatch warnings:
>> drivers/xen/xen-pciback/conf_space_capability.c:163
>> pm_ctrl_init() warn: passing zero to 'ERR_PTR'
>>
>> Fixes: a92336a1176b ("xen/pciback: Drop two backends, squash and cleanup some code.")
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>
> Reviewed-by: Juergen Gross <jgross@suse.com>
>
Applied to for-linux-5.16.
-boris
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-27 13:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 7:44 [PATCH -next] xen-pciback: Fix return in pm_ctrl_init() YueHaibing
2021-10-08 15:01 ` Juergen Gross
2021-10-27 13:18 ` Boris Ostrovsky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.