Patchwork remove redundant check for file's private_data

login
register
mail settings
Submitter Shirish Pargaonkar
Date March 10, 2010, 6:49 p.m.
Message ID <4a4634331003101049n242cf6e4kd992101ff239a265@mail.gmail.com>
Download mbox | patch
Permalink /patch/47277/
State New
Headers show

Comments

Shirish Pargaonkar - March 10, 2010, 6:49 p.m.
This check is redundant, whether private_data is NULL gets verified in
initiate_cifs_search already.

Signed-off-by: Shirish Pargaonkar shirishpargaonkar@gmail.com

From c1945aa4698725f8f69c3e402fee7062468075c3 Mon Sep 17 00:00:00 2001
From: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Date: Wed, 10 Mar 2010 12:24:18 -0600
Subject: [PATCH] remove redundant check for cifs file data

---
 fs/cifs/readdir.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

 			if (cifsFile->srch_inf.emptyDir) {

Patch

diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index c343b14..e8a7794 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -812,11 +812,7 @@  int cifs_readdir(struct file *file, void
*direntry, filldir_t filldir)
 				return rc;
 			}
 		}
-		if (file->private_data == NULL) {
-			rc = -EINVAL;
-			FreeXid(xid);
-			return rc;
-		}
+
 		cifsFile = file->private_data;
 		if (cifsFile->srch_inf.endOfSearch) {