Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 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>

authored by

Richard Acayan and committed by
Greg Kroah-Hartman
b6a06285 3c7d0079

+3 -1
+3 -1
drivers/misc/fastrpc.c
··· 2349 2349 struct fastrpc_invoke_ctx *ctx; 2350 2350 2351 2351 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; 2353 2354 complete(&ctx->work); 2355 + } 2354 2356 spin_unlock(&user->lock); 2355 2357 } 2356 2358