Skip to content

Commit

Permalink
[PATCH] cifs: remove cifs_kcalloc and check for NULL return on kcallo…
Browse files Browse the repository at this point in the history
…c in session initialization

Suggested by: Adrian Bunk and Dave Miller

Signed-off-by: Steve French ([email protected])
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Steve French authored and Linus Torvalds committed Apr 29, 2005
1 parent 099a58f commit 433dc24
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 59 deletions.
15 changes: 11 additions & 4 deletions fs/cifs/cifs_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,21 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
list_for_each(tmp, &GlobalSMBSessionList) {
i++;
ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList);
length =
sprintf(buf,
"\n%d) Name: %s Domain: %s Mounts: %d ServerOS: %s \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\t",
if((ses->serverDomain == NULL) || (ses->serverOS == NULL) ||
(ses->serverNOS == NULL)) {
buf += sprintf("\nentry for %s not fully displayed\n\t",
ses->serverName);

} else {
length =
sprintf(buf,
"\n%d) Name: %s Domain: %s Mounts: %d ServerOS: %s \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\t",
i, ses->serverName, ses->serverDomain,
atomic_read(&ses->inUse),
ses->serverOS, ses->serverNOS,
ses->capabilities,ses->status);
buf += length;
buf += length;
}
if(ses->server) {
buf += sprintf(buf, "TCP status: %d\n\tLocal Users To Server: %d SecMode: 0x%x Req Active: %d",
ses->server->tcpStatus,
Expand Down
Loading

0 comments on commit 433dc24

Please sign in to comment.