mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-25 10:59:05 +00:00
cxl: Fix error handling in _cxl_pci_associate_default_context()
'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 <christophe.jaillet@wanadoo.fr> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Acked-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
28e323e5a0
commit
bb81733de2
@ -1921,7 +1921,7 @@ static pci_ers_result_t cxl_pci_slot_reset(struct pci_dev *pdev)
|
||||
goto err;
|
||||
|
||||
ctx = cxl_dev_context_init(afu_dev);
|
||||
if (!ctx)
|
||||
if (IS_ERR(ctx))
|
||||
goto err;
|
||||
|
||||
afu_dev->dev.archdata.cxl_ctx = ctx;
|
||||
|
@ -20,7 +20,7 @@ bool _cxl_pci_associate_default_context(struct pci_dev *dev, struct cxl_afu *afu
|
||||
* in the virtual phb, we'll need a default context to attach them to.
|
||||
*/
|
||||
ctx = cxl_dev_context_init(dev);
|
||||
if (!ctx)
|
||||
if (IS_ERR(ctx))
|
||||
return false;
|
||||
dev->dev.archdata.cxl_ctx = ctx;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user