xen-pciback: Fix return in pm_ctrl_init()
PATCH 1/1 xen-pciback: Fix return in pm_ctrl_init()
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 <[email protected]>
--- drivers/xen/xen-pciback/conf_space_capability.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/xen-pciback/conf_space_capability.c +1 -1
@@ -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[] = {
Signature · 1 line
2.17.1
Quoted 7 lines · YueHaibing
Return NULL instead of passing to
ERR_PTRwhile 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 <[email protected]>
Reviewed-by Juergen Gross <[email protected]>
Juergen
Boris Ostrovsky
AppliedQuoted 11 lines · Juergen Gross
Quoted 7 lines · YueHaibing
Return NULL instead of passing to
ERR_PTRwhile err is zero, this fix smatch warnings:drivers/xen/xen-pciback/conf_space_capability.c:163pm_ctrl_init()warn: passing zero to 'ERR_PTR'Fixes a92336a1176b ("xen/pciback: Drop two backends, squash and cleanup some code.")Signed-off-by YueHaibing <[email protected]>Reviewed-by Juergen Gross <[email protected]>
Applied to for-linux-5.16.
-boris