浏览代码

iscsi-target: Put length of failed allocation in error message

If the message "Unable to allocate…" pops up, it's useful to know
whether the problem is that the system is genuinely out of memory, or
that some bug has led to a crazy allocation length.

In particular this helped debug a corruption of login headers in
iscsi_login_non_zero_tsih_s1().

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Roland Dreier 11 年之前
父节点
当前提交
cee6029ecf
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/target/iscsi/iscsi_target_parameters.c

+ 1 - 1
drivers/target/iscsi/iscsi_target_parameters.c

@@ -1605,7 +1605,7 @@ int iscsi_decode_text_input(
 
 	tmpbuf = kzalloc(length + 1, GFP_KERNEL);
 	if (!tmpbuf) {
-		pr_err("Unable to allocate memory for tmpbuf.\n");
+		pr_err("Unable to allocate %u + 1 bytes for tmpbuf.\n", length);
 		return -1;
 	}