]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - lib/hexdump.c
Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-bionic-kernel.git] / lib / hexdump.c
index 992457b1284c186d8e0d7b8c5d7b5fc349c18ef3..81b70ed37209697c083247264c9374b143c1749f 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <linux/types.h>
 #include <linux/ctype.h>
+#include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/export.h>
 #include <asm/unaligned.h>
@@ -42,7 +43,7 @@ EXPORT_SYMBOL(hex_to_bin);
  * @src: ascii hexadecimal string
  * @count: result length
  *
- * Return 0 on success, -1 in case of bad input.
+ * Return 0 on success, -EINVAL in case of bad input.
  */
 int hex2bin(u8 *dst, const char *src, size_t count)
 {
@@ -51,7 +52,7 @@ int hex2bin(u8 *dst, const char *src, size_t count)
                int lo = hex_to_bin(*src++);
 
                if ((hi < 0) || (lo < 0))
-                       return -1;
+                       return -EINVAL;
 
                *dst++ = (hi << 4) | lo;
        }