]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/md/dm-crypt.c
dm: replace simple_strtoul
[karo-tx-linux.git] / drivers / md / dm-crypt.c
index 3f06df59fd824022fd80a9c77551178660909eb6..e2b32401ecc7b3345c148b9518885ce466d849af 100644 (file)
@@ -1241,7 +1241,6 @@ static void kcryptd_queue_crypt(struct dm_crypt_io *io)
 static int crypt_decode_key(u8 *key, char *hex, unsigned int size)
 {
        char buffer[3];
-       char *endp;
        unsigned int i;
 
        buffer[2] = '\0';
@@ -1250,9 +1249,7 @@ static int crypt_decode_key(u8 *key, char *hex, unsigned int size)
                buffer[0] = *hex++;
                buffer[1] = *hex++;
 
-               key[i] = (u8)simple_strtoul(buffer, &endp, 16);
-
-               if (endp != &buffer[2])
+               if (kstrtou8(buffer, 16, &key[i]))
                        return -EINVAL;
        }