aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-10-11 23:03:18 -0400
committerSteve French <sfrench@us.ibm.com>2005-10-11 23:03:18 -0400
commit47c786e79b46ef478a1123cb57c711ecb481cbfa (patch)
tree915f408208c8930ccefff3ea8a137ec5fd395b22 /fs/cifs/cifssmb.c
parent1047abc159b4eb4ba4a7342a0969e16e9d4b4c69 (diff)
[CIFS] Add null malloc response check in notify experimental code
Signed-off-by: Steve French (sfrench@us.ibm.com)
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 41996a240149..9312bfc56682 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -4294,20 +4294,26 @@ int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon,
4294 cFYI(1, ("Error in Notify = %d", rc)); 4294 cFYI(1, ("Error in Notify = %d", rc));
4295 } else { 4295 } else {
4296 /* Add file to outstanding requests */ 4296 /* Add file to outstanding requests */
4297 /* BB change to kmem cache alloc */
4297 dnotify_req = (struct dir_notify_req *) kmalloc( 4298 dnotify_req = (struct dir_notify_req *) kmalloc(
4298 sizeof(struct dir_notify_req), GFP_KERNEL); 4299 sizeof(struct dir_notify_req),
4299 dnotify_req->Pid = pSMB->hdr.Pid; 4300 GFP_KERNEL);
4300 dnotify_req->PidHigh = pSMB->hdr.PidHigh; 4301 if(dnotify_req) {
4301 dnotify_req->Mid = pSMB->hdr.Mid; 4302 dnotify_req->Pid = pSMB->hdr.Pid;
4302 dnotify_req->Tid = pSMB->hdr.Tid; 4303 dnotify_req->PidHigh = pSMB->hdr.PidHigh;
4303 dnotify_req->Uid = pSMB->hdr.Uid; 4304 dnotify_req->Mid = pSMB->hdr.Mid;
4304 dnotify_req->netfid = netfid; 4305 dnotify_req->Tid = pSMB->hdr.Tid;
4305 dnotify_req->pfile = pfile; 4306 dnotify_req->Uid = pSMB->hdr.Uid;
4306 dnotify_req->filter = filter; 4307 dnotify_req->netfid = netfid;
4307 dnotify_req->multishot = multishot; 4308 dnotify_req->pfile = pfile;
4308 spin_lock(&GlobalMid_Lock); 4309 dnotify_req->filter = filter;
4309 list_add_tail(&dnotify_req->lhead, &GlobalDnotifyReqList); 4310 dnotify_req->multishot = multishot;
4310 spin_unlock(&GlobalMid_Lock); 4311 spin_lock(&GlobalMid_Lock);
4312 list_add_tail(&dnotify_req->lhead,
4313 &GlobalDnotifyReqList);
4314 spin_unlock(&GlobalMid_Lock);
4315 } else
4316 rc = -ENOMEM;
4311 } 4317 }
4312 cifs_buf_release(pSMB); 4318 cifs_buf_release(pSMB);
4313 return rc; 4319 return rc;