summaryrefslogtreecommitdiff
path: root/fs/cifs/cifs_debug.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-09-15 03:01:17 +0000
committerSteve French <sfrench@us.ibm.com>2007-09-15 03:01:17 +0000
commit88f370a688e765de9755a343702ca04e6817e5f5 (patch)
tree82ad179c2310cf60c8aa83c50e221f363b51d8fe /fs/cifs/cifs_debug.c
parent638b250766272fcaaa0f7ed2776f58f4ac701914 (diff)
downloadlinux-next-88f370a688e765de9755a343702ca04e6817e5f5.tar.gz
[CIFS] Fix potential NULL pointer usage if kzalloc fails
Potential problem was noticed by Cyrill Gorcunov CC: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifs_debug.c')
-rw-r--r--fs/cifs/cifs_debug.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 1bf8cf522ad6..0356694b5cd0 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -209,13 +209,15 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
i++;
tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType);
- length =
- sprintf(buf,
- "\n%d) %s Uses: %d Type: %s DevInfo: 0x%x "
- "Attributes: 0x%x\nPathComponentMax: %d Status: %d",
- i, tcon->treeName,
- atomic_read(&tcon->useCount),
- tcon->nativeFileSystem,
+ length = sprintf(buf, "\n%d) %s Uses: %d ", i,
+ tcon->treeName, atomic_read(&tcon->useCount));
+ buf += length;
+ if (tcon->nativeFileSystem) {
+ length = sprintf("Type: %s ", tcon->nativeFileSystem);
+ buf += length;
+ }
+ length = sprintf(buf, "DevInfo: 0x%x Attributes: 0x%x"
+ "\nPathComponentMax: %d Status: %d",
le32_to_cpu(tcon->fsDevInfo.DeviceCharacteristics),
le32_to_cpu(tcon->fsAttrInfo.Attributes),
le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength),