• J
    [CRYPTO] Add null short circuit to crypto_free_tfm · a61cc448
    Jesper Juhl 提交于
    As far as I'm aware there's a general concensus that functions that are
    responsible for freeing resources should be able to cope with being passed
    a NULL pointer. This makes sense as it removes the need for all callers to
    check for NULL, thus elliminating the bugs that happen when some forget
    (safer to just check centrally in the freeing function) and it also makes
    for smaller code all over due to the lack of all those NULL checks.
    This patch makes it safe to pass the crypto_free_tfm() function a NULL
    pointer. Once this patch is applied we can start removing the NULL checks
    from the callers.
    Signed-off-by: NJesper Juhl <juhl-lkml@dif.dk>
    Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    a61cc448
api.c 5.3 KB