[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YZ+vr+ahkzvWU+Wd@kroah.com>
Date: Thu, 25 Nov 2021 16:45:51 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Jeya R <jeyr@...eaurora.org>
Cc: linux-arm-msm@...r.kernel.org, srinivas.kandagatla@...aro.org,
linux-kernel@...r.kernel.org, fastrpc.upstream@....qualcomm.com
Subject: Re: [PATCH 2/5] misc: fastrpc: Add secure device node support
On Thu, Nov 25, 2021 at 07:45:41PM +0530, Jeya R wrote:
> Register and deregister secure device node. Check for device name during
> device open get proper channel context.
>
> Signed-off-by: Jeya R <jeyr@...eaurora.org>
> ---
> drivers/misc/fastrpc.c | 33 +++++++++++++++++++++++++++++++--
> 1 file changed, 31 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 39aca77..0775554e 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -79,6 +79,7 @@
> #define SENSORS_PD (2)
>
> #define miscdev_to_cctx(d) container_of(d, struct fastrpc_channel_ctx, miscdev)
> +#define securedev_to_cctx(d) container_of(d, struct fastrpc_channel_ctx, securedev)
>
> static const char *domains[FASTRPC_DEV_MAX] = { "adsp", "mdsp",
> "sdsp", "cdsp"};
> @@ -213,6 +214,7 @@ struct fastrpc_channel_ctx {
> struct idr ctx_idr;
> struct list_head users;
> struct miscdevice miscdev;
> + struct miscdevice securedev;
> struct kref refcount;
Wow, you now have 3 structures with reference counts all trying to
manage the same structure. That's 2 more than you need.
This is not ok, please do not do that.
greg k-h
Powered by blists - more mailing lists