diff options
author | John Garry <john.garry@huawei.com> | 2018-11-05 15:35:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-21 11:19:17 +0300 |
commit | 12555475a0618771ae03159cd290c9a6085294df (patch) | |
tree | cd5773c46dacaf12ef7c096028f36ce8265418ac /drivers/vhost | |
parent | 093d6ab590bd6b2f2f3528b530e0eeedb8da55bd (diff) | |
download | linux-12555475a0618771ae03159cd290c9a6085294df.tar.xz |
crypto: hisilicon - Fix reference after free of memories on error path
commit 0b0cf6af3f3151c26c27e8e51def5527091c3e69 upstream.
coccicheck currently warns of the following issues in the driver:
drivers/crypto/hisilicon/sec/sec_algs.c:864:51-66: ERROR: reference preceded by free on line 812
drivers/crypto/hisilicon/sec/sec_algs.c:864:40-49: ERROR: reference preceded by free on line 813
drivers/crypto/hisilicon/sec/sec_algs.c:861:8-24: ERROR: reference preceded by free on line 814
drivers/crypto/hisilicon/sec/sec_algs.c:860:41-51: ERROR: reference preceded by free on line 815
drivers/crypto/hisilicon/sec/sec_algs.c:867:7-18: ERROR: reference preceded by free on line 816
It would appear than on certain error paths that we may attempt reference-
after-free some memories.
This patch fixes those issues. The solution doesn't look perfect, but
having same memories free'd possibly from separate functions makes it
tricky.
Fixes: 915e4e8413da ("crypto: hisilicon - SEC security accelerator driver")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vhost')
0 files changed, 0 insertions, 0 deletions