xen-pciback: Fix return in pm_ctrl_init()

[ Upstream commit 4745ea2628 ]

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: a92336a117 ("xen/pciback: Drop two backends, squash and cleanup some code.")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20211008074417.8260-1-yuehaibing@huawei.com
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
YueHaibing 2021-10-08 15:44:17 +08:00 committed by Greg Kroah-Hartman
parent db651ace49
commit f314286463
1 changed files with 1 additions and 1 deletions

View File

@ -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[] = {