Skip to contentSkip to conversation

mm: do_generic_file_read() doesn't need to validate filp

PATCH In review Krishna Kumar 3 participants 3 messages Sep 22, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: do_generic_file_read() doesn't need to validate filp

From: Krishna Kumar <[email protected]>

do_generic_file_read() doesn't need to validate filp when accessing it. This is probably a remnant of an earlier code.

---
 mm/filemap.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/filemap.c +1 -2
diff -ruNp 2.6.27-rc7-org/mm/filemap.c 2.6.27-rc7-new/mm/filemap.c
@@ -1186,8 +1186,7 @@ out:
 	ra->prev_pos |= prev_offset;
 
 	*ppos = ((loff_t)index << PAGE_CACHE_SHIFT) + offset;
-	if (filp)
-		file_accessed(filp);
+	file_accessed(filp);
 }
 
 int file_read_actor(read_descriptor_t *desc, struct page *page,
Reviewed-by on v1 1/1
#1 lore raw

Hi

Please write explictly that filp is never passed NULL for patch description clarify. Otherthing, looks good to me.

Quoted 28 lines

From: Krishna Kumar <[email protected]>

do_generic_file_read() doesn't need to validate filp when accessing it. This is probably a remnant of an earlier code.

---
 mm/filemap.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff -ruNp 2.6.27-rc7-org/mm/filemap.c 2.6.27-rc7-new/mm/filemap.c

mm/filemap.c +1 -3
@@ -1186,8 +1186,7 @@ out:
 	ra->prev_pos |= prev_offset;
 
 	*ppos = ((loff_t)index << PAGE_CACHE_SHIFT) + offset;
-	if (filp)
-		file_accessed(filp);
+	file_accessed(filp);
 }
 
 int file_read_actor(read_descriptor_t *desc, struct page *page,
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/