lkml.org 
[lkml]   [2012]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] allow padlock module to load without xcrypt support
    Date
    Lack of (enabled) hardware is arguably not a module initialization error,
    thus it should not cause problems during the boot process.

    Signed-off-by: Laszlo Ersek <lersek@redhat.com>
    ---
    Please CC me on any comments. Thanks.

    drivers/crypto/padlock-aes.c | 7 +++++--
    1 files changed, 5 insertions(+), 2 deletions(-)

    diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c
    index 37b2e94..a42a308 100644
    --- a/drivers/crypto/padlock-aes.c
    +++ b/drivers/crypto/padlock-aes.c
    @@ -516,11 +516,11 @@ static int __init padlock_init(void)
    struct cpuinfo_x86 *c = &cpu_data(0);

    if (!x86_match_cpu(padlock_cpu_id))
    - return -ENODEV;
    + return 0;

    if (!cpu_has_xcrypt_enabled) {
    printk(KERN_NOTICE PFX "VIA PadLock detected, but not enabled. Hmm, strange...\n");
    - return -ENODEV;
    + return 0;
    }

    if ((ret = crypto_register_alg(&aes_alg)))
    @@ -554,6 +554,9 @@ aes_err:

    static void __exit padlock_fini(void)
    {
    + if (!x86_match_cpu(padlock_cpu_id) || !cpu_has_xcrypt_enabled)
    + return;
    +
    crypto_unregister_alg(&cbc_aes_alg);
    crypto_unregister_alg(&ecb_aes_alg);
    crypto_unregister_alg(&aes_alg);
    --
    1.7.1


    \
     
     \ /
      Last update: 2012-06-20 12:01    [W:0.020 / U:2.980 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site