Previously, when attaching a context in dedicated mode, we ignored
the result of add_process_element, which could potentially fail.

If add_process_element returns and error, pass it back to the caller.

Signed-off-by: Daniel Axtens <d...@axtens.net>

---

I'm not sure if this is worth sending to stable: it doesn't fix
any actual bug, it just lets us know earlier if we've failed.

However, if mpe, Mikey or Ian feel like it should go to stable I
have no objection to that either.
---
 drivers/misc/cxl/native.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
index debd97147b58..22c06d91faa8 100644
--- a/drivers/misc/cxl/native.c
+++ b/drivers/misc/cxl/native.c
@@ -551,9 +551,7 @@ static int attach_afu_directed(struct cxl_context *ctx, u64 
wed, u64 amr)
        if ((result = cxl_afu_check_and_enable(ctx->afu)))
                return result;
 
-       add_process_element(ctx);
-
-       return 0;
+       return add_process_element(ctx);
 }
 
 static int deactivate_afu_directed(struct cxl_afu *afu)
-- 
2.1.4

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to