Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iscsi-target: Fix hex2bin warn_unused compile message

Fix the following compile warning with hex2bin() usage:

drivers/target/iscsi/iscsi_target_auth.c: In function ‘chap_string_to_hex’:
drivers/target/iscsi/iscsi_target_auth.c:35: warning: ignoring return value of ‘hex2bin’, declared with attribute warn_unused_result

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

+4 -2
+4 -2
drivers/target/iscsi/iscsi_target_auth.c
··· 30 30 31 31 static int chap_string_to_hex(unsigned char *dst, unsigned char *src, int len) 32 32 { 33 - int j = DIV_ROUND_UP(len, 2); 33 + int j = DIV_ROUND_UP(len, 2), rc; 34 34 35 - hex2bin(dst, src, j); 35 + rc = hex2bin(dst, src, j); 36 + if (rc < 0) 37 + pr_debug("CHAP string contains non hex digit symbols\n"); 36 38 37 39 dst[j] = '\0'; 38 40 return j;