* [bug report] tee: add supp_nowait flag in tee_context struct
@ 2019-02-19 13:25 Dan Carpenter
2019-02-20 6:20 ` Sumit Garg
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-02-19 13:25 UTC (permalink / raw)
To: kernel-janitors
Hello Sumit Garg,
The patch 42bf4152d8a7: "tee: add supp_nowait flag in tee_context
struct" from Jan 29, 2019, leads to the following static checker
warning:
drivers/tee/tee_core.c:996 tee_client_open_context()
error: 'ctx' dereferencing possible ERR_PTR()
drivers/tee/tee_core.c
986 } while (IS_ERR(ctx) && PTR_ERR(ctx) != -ENOMEM);
^^^^^^^^^^^^^^^^^^^^^^^^
ctx can be ERR_PTR(-ENOMEM);
987
988 put_device(put_dev);
989 /*
990 * Default behaviour for in kernel client is to not wait for
991 * tee-supplicant if not present for any requests in this context.
992 * Also this flag could be configured again before call to
993 * tee_client_open_session() if any in kernel client requires
994 * different behaviour.
995 */
--> 996 ctx->supp_nowait = true;
^^^^^^^^^^^^^^^^
And it leads to an Oops here.
997 return ctx;
998 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [bug report] tee: add supp_nowait flag in tee_context struct
2019-02-19 13:25 [bug report] tee: add supp_nowait flag in tee_context struct Dan Carpenter
@ 2019-02-20 6:20 ` Sumit Garg
0 siblings, 0 replies; 2+ messages in thread
From: Sumit Garg @ 2019-02-20 6:20 UTC (permalink / raw)
To: kernel-janitors
Hi Dan Carpenter,
Thanks for this bug report. I have sent corresponding fix in upstream [1].
[1] https://lkml.org/lkml/2019/2/20/37
Regards,
Sumit
On Tue, 19 Feb 2019 at 18:56, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Hello Sumit Garg,
>
> The patch 42bf4152d8a7: "tee: add supp_nowait flag in tee_context
> struct" from Jan 29, 2019, leads to the following static checker
> warning:
>
> drivers/tee/tee_core.c:996 tee_client_open_context()
> error: 'ctx' dereferencing possible ERR_PTR()
>
> drivers/tee/tee_core.c
> 986 } while (IS_ERR(ctx) && PTR_ERR(ctx) != -ENOMEM);
> ^^^^^^^^^^^^^^^^^^^^^^^^
> ctx can be ERR_PTR(-ENOMEM);
>
> 987
> 988 put_device(put_dev);
> 989 /*
> 990 * Default behaviour for in kernel client is to not wait for
> 991 * tee-supplicant if not present for any requests in this context.
> 992 * Also this flag could be configured again before call to
> 993 * tee_client_open_session() if any in kernel client requires
> 994 * different behaviour.
> 995 */
> --> 996 ctx->supp_nowait = true;
> ^^^^^^^^^^^^^^^^
> And it leads to an Oops here.
>
> 997 return ctx;
> 998 }
>
> regards,
> dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-20 6:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-19 13:25 [bug report] tee: add supp_nowait flag in tee_context struct Dan Carpenter
2019-02-20 6:20 ` Sumit Garg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox