summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Acayan <mailingradian@gmail.com>2023-05-23 16:25:49 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-09 10:32:29 +0200
commitcebe84b9c02e01569b47f54cf95497c1f6bbc2ec (patch)
treeacb6c5454cb86f08999d7644d83e1c76bef3a6e3
parentd3103fc0d1914ae21d717720a5c2131be4b42b24 (diff)
downloadlinux-cebe84b9c02e01569b47f54cf95497c1f6bbc2ec.tar.gz
linux-cebe84b9c02e01569b47f54cf95497c1f6bbc2ec.tar.bz2
linux-cebe84b9c02e01569b47f54cf95497c1f6bbc2ec.zip
misc: fastrpc: return -EPIPE to invocations on device removal
commit b6a062853ddf6b4f653af2d8b75ba45bb9a036ad upstream. The return value is initialized as -1, or -EPERM. The completion of an invocation implies that the return value is set appropriately, but "Permission denied" does not accurately describe the outcome of the invocation. Set the invocation's return value to a more appropriate "Broken pipe", as the cleanup breaks the driver's connection with rpmsg. Fixes: c68cfb718c8f ("misc: fastrpc: Add support for context Invoke method") Cc: stable <stable@kernel.org> Signed-off-by: Richard Acayan <mailingradian@gmail.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230523152550.438363-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/misc/fastrpc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 55e42ccaef43..f78fb835dfa4 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -1677,8 +1677,10 @@ static void fastrpc_notify_users(struct fastrpc_user *user)
struct fastrpc_invoke_ctx *ctx;
spin_lock(&user->lock);
- list_for_each_entry(ctx, &user->pending, node)
+ list_for_each_entry(ctx, &user->pending, node) {
+ ctx->retval = -EPIPE;
complete(&ctx->work);
+ }
spin_unlock(&user->lock);
}