diff options
| author | Christophe Jaillet <[email protected]> | 2016-10-30 22:34:51 +0100 |
|---|---|---|
| committer | Michael Ellerman <[email protected]> | 2016-11-18 22:41:08 +1100 |
| commit | 28e323e5a0b21b3665eb6e136ca8bbce10fd29d7 (patch) | |
| tree | b30a54fd82da25ff01f7c4f778d43af1e4be8f04 | |
| parent | 5cd4f5cec2374d2c09299211d2b357cc160e49a0 (diff) | |
cxl: Fix error handling in _cxl_cx4_setup_msi_irqs()
'cxl_dev_context_init()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.
Signed-off-by: Christophe JAILLET <[email protected]>
Reviewed-by: Andrew Donnellan <[email protected]>
Acked-by: Frederic Barrat <[email protected]>
Acked-by: Ian Munsie <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
| -rw-r--r-- | drivers/misc/cxl/api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c index 2b88ad8a2a89..e2efc6489c6e 100644 --- a/drivers/misc/cxl/api.c +++ b/drivers/misc/cxl/api.c @@ -538,7 +538,7 @@ int _cxl_cx4_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) if (remaining > 0) { new_ctx = cxl_dev_context_init(pdev); - if (!new_ctx) { + if (IS_ERR(new_ctx)) { pr_warn("%s: Failed to allocate enough contexts for MSIs\n", pci_name(pdev)); return -ENOSPC; } |