• John Garry's avatar
    crypto: hisilicon - Fix reference after free of memories on error path · 0b0cf6af
    John Garry authored
    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: 915e4e84 ("crypto: hisilicon - SEC security accelerator driver")
    Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    0b0cf6af
Name
Last commit
Last update
..
sec Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...