diff options
author | Dan Carpenter <[email protected]> | 2020-05-12 16:19:17 +0300 |
---|---|---|
committer | Mimi Zohar <[email protected]> | 2020-05-14 19:55:54 -0400 |
commit | 8433856947217ebb5697a8ff9c4c9cad4639a2cf (patch) | |
tree | c85e552f9a199f1996efbd103abebf6dd52cbc63 /drivers/fpga/fpga-mgr.c | |
parent | 770f60586d2af0590be263f55fd079226313922c (diff) |
evm: Fix a small race in init_desc()
The IS_ERR_OR_NULL() function has two conditions and if we got really
unlucky we could hit a race where "ptr" started as an error pointer and
then was set to NULL. Both conditions would be false even though the
pointer at the end was NULL.
This patch fixes the problem by ensuring that "*tfm" can only be NULL
or valid. I have introduced a "tmp_tfm" variable to make that work. I
also reversed a condition and pulled the code in one tab.
Reported-by: Roberto Sassu <[email protected]>
Fixes: 53de3b080d5e ("evm: Check also if *tfm is an error pointer in init_desc()")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Roberto Sassu <[email protected]>
Acked-by: Krzysztof Struczynski <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-mgr.c')
0 files changed, 0 insertions, 0 deletions