]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - lib/strnlen_user.c
idr: Fix idr_get_next race with idr_remove
[mirror_ubuntu-bionic-kernel.git] / lib / strnlen_user.c
index 60d0bbda8f5e581178719e9122b0e9f19b0876a5..184f80f7bacfa96ce500f9ad40cb11aeaea06627 100644 (file)
@@ -28,7 +28,7 @@
 static inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max)
 {
        const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
-       long align, res = 0;
+       unsigned long align, res = 0;
        unsigned long c;
 
        /*
@@ -42,7 +42,7 @@ static inline long do_strnlen_user(const char __user *src, unsigned long count,
         * Do everything aligned. But that means that we
         * need to also expand the maximum..
         */
-       align = (sizeof(long) - 1) & (unsigned long)src;
+       align = (sizeof(unsigned long) - 1) & (unsigned long)src;
        src -= align;
        max += align;