diff options
author | Steve French <smfrench@austin.rr.com> | 2005-04-29 01:41:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-29 01:41:08 -0400 |
commit | 433dc24f24b409fb130f638aa85470a0eb666206 (patch) | |
tree | c64f3c478297b38361f91fea0609fb4fbedaffaf /fs/cifs/cifs_debug.c | |
parent | 099a58f681ed951434574ec39bdfe87055bafe73 (diff) |
[PATCH] cifs: remove cifs_kcalloc and check for NULL return on kcalloc in session initialization
Suggested by: Adrian Bunk and Dave Miller
Signed-off-by: Steve French (sfrench@us.ibm.com)
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/cifs/cifs_debug.c')
-rw-r--r-- | fs/cifs/cifs_debug.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index bff2ec6e054a..4061e43471c1 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -89,14 +89,21 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
89 | list_for_each(tmp, &GlobalSMBSessionList) { | 89 | list_for_each(tmp, &GlobalSMBSessionList) { |
90 | i++; | 90 | i++; |
91 | ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); | 91 | ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); |
92 | length = | 92 | if((ses->serverDomain == NULL) || (ses->serverOS == NULL) || |
93 | sprintf(buf, | 93 | (ses->serverNOS == NULL)) { |
94 | "\n%d) Name: %s Domain: %s Mounts: %d ServerOS: %s \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\t", | 94 | buf += sprintf("\nentry for %s not fully displayed\n\t", |
95 | ses->serverName); | ||
96 | |||
97 | } else { | ||
98 | length = | ||
99 | sprintf(buf, | ||
100 | "\n%d) Name: %s Domain: %s Mounts: %d ServerOS: %s \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\t", | ||
95 | i, ses->serverName, ses->serverDomain, | 101 | i, ses->serverName, ses->serverDomain, |
96 | atomic_read(&ses->inUse), | 102 | atomic_read(&ses->inUse), |
97 | ses->serverOS, ses->serverNOS, | 103 | ses->serverOS, ses->serverNOS, |
98 | ses->capabilities,ses->status); | 104 | ses->capabilities,ses->status); |
99 | buf += length; | 105 | buf += length; |
106 | } | ||
100 | if(ses->server) { | 107 | if(ses->server) { |
101 | buf += sprintf(buf, "TCP status: %d\n\tLocal Users To Server: %d SecMode: 0x%x Req Active: %d", | 108 | buf += sprintf(buf, "TCP status: %d\n\tLocal Users To Server: %d SecMode: 0x%x Req Active: %d", |
102 | ses->server->tcpStatus, | 109 | ses->server->tcpStatus, |