Skip to content

Commit 4745ea2

Browse files
YueHaibingbostrovs
authored andcommitted
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: a92336a ("xen/pciback: Drop two backends, squash and cleanup some code.") Signed-off-by: YueHaibing <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Boris Ostrovsky <[email protected]>
1 parent 9a58b35 commit 4745ea2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/xen/xen-pciback/conf_space_capability.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static void *pm_ctrl_init(struct pci_dev *dev, int offset)
160160
}
161161

162162
out:
163-
return ERR_PTR(err);
163+
return err ? ERR_PTR(err) : NULL;
164164
}
165165

166166
static const struct config_field caplist_pm[] = {

0 commit comments

Comments
 (0)