]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - lib/test_kmod.c
test_kmod: fix bug which allows negative values on two config options
[mirror_ubuntu-artful-kernel.git] / lib / test_kmod.c
index 90c91541fc16d497e668ac0c4fae2491f5751e94..8fc0a7a19c8399c6f3f8f4ff7dbf795064239ee8 100644 (file)
@@ -880,10 +880,10 @@ static int test_dev_config_update_uint_sync(struct kmod_test_device *test_dev,
                                            int (*test_sync)(struct kmod_test_device *test_dev))
 {
        int ret;
-       long new;
+       unsigned long new;
        unsigned int old_val;
 
-       ret = kstrtol(buf, 10, &new);
+       ret = kstrtoul(buf, 10, &new);
        if (ret)
                return ret;
 
@@ -918,9 +918,9 @@ static int test_dev_config_update_uint_range(struct kmod_test_device *test_dev,
                                             unsigned int max)
 {
        int ret;
-       long new;
+       unsigned long new;
 
-       ret = kstrtol(buf, 10, &new);
+       ret = kstrtoul(buf, 10, &new);
        if (ret)
                return ret;