iscsi-target: Put length of failed allocation in error message
authorRoland Dreier <roland@purestorage.com>
Thu, 29 May 2014 20:32:29 +0000 (13:32 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 4 Jun 2014 02:18:43 +0000 (19:18 -0700)
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>
drivers/target/iscsi/iscsi_target_parameters.c

index 4d2e23fc76fda72be2b7ec59c801f0696a8470e3..8ca82ab4305429b767f73ea5dc9df1135362786f 100644 (file)
@@ -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;
        }