Skip to content

Commit b6a0628

Browse files
flamingradiangregkh
authored andcommitted
misc: fastrpc: return -EPIPE to invocations on device removal
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: c68cfb7 ("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>
1 parent 3c7d007 commit b6a0628

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/misc/fastrpc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2349,8 +2349,10 @@ static void fastrpc_notify_users(struct fastrpc_user *user)
23492349
struct fastrpc_invoke_ctx *ctx;
23502350

23512351
spin_lock(&user->lock);
2352-
list_for_each_entry(ctx, &user->pending, node)
2352+
list_for_each_entry(ctx, &user->pending, node) {
2353+
ctx->retval = -EPIPE;
23532354
complete(&ctx->work);
2355+
}
23542356
spin_unlock(&user->lock);
23552357
}
23562358

0 commit comments

Comments
 (0)