• Prarit Bhargava's avatar
    hwrng: geode - Revert managed API changes · c445f996
    Prarit Bhargava authored
    commit 8c75704e upstream.
    
    After commit e9afc746 ("hwrng: geode - Use linux/io.h instead of
    asm/io.h") the geode-rng driver uses devres with pci_dev->dev to keep
    track of resources, but does not actually register a PCI driver.  This
    results in the following issues:
    
    1.  The driver leaks memory because the driver does not attach to a
    device.  The driver only uses the PCI device as a reference.   devm_*()
    functions will release resources on driver detach, which the geode-rng
    driver will never do.  As a result,
    
    2.  The driver cannot be reloaded because there is always a use of the
    ioport and region after the first load of the driver.
    
    Revert the changes made by  e9afc746 ("hwrng: geode - Use linux/io.h
    instead of asm/io.h").
    Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
    Fixes: 6e9b5e76 ("hwrng: geode - Migrate to managed API")
    Cc: Matt Mackall <mpm@selenic.com>
    Cc: Corentin LABBE <clabbe.montjoie@gmail.com>
    Cc: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
    Cc: Wei Yongjun <weiyongjun1@huawei.com>
    Cc: linux-crypto@vger.kernel.org
    Cc: linux-geode@lists.infradead.org
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    c445f996
geode-rng.c 2.96 KB