public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* fscache: bug report: dereferencing before checking
@ 2010-03-22 12:07 Dan Carpenter
  2010-03-22 12:47 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-03-22 12:07 UTC (permalink / raw)
  To: kernel-janitors

Can "page" be NULL here?

fs/fscache/page.c +712
   705          page = results[0];
   706          _debug("gang %d [%lx]", n, page->index);
                                           ^^^^^^^^^^^
	dereference

   707          if (page->index > op->store_limit) {
                    ^^^^^^^^^^^
	dereference

   708                  fscache_stat(&fscache_n_store_pages_over_limit);
   709                  goto superseded;
   710          }
   711
   712          if (page) {

	check

   713                  radix_tree_tag_set(&cookie->stores, page->index,
   714                                     FSCACHE_COOKIE_STORING_TAG);
   715                  radix_tree_tag_clear(&cookie->stores, page->index,
   716                                       FSCACHE_COOKIE_PENDING_TAG);
   717          }
   718
   719          spin_unlock(&cookie->stores_lock);
   720          spin_unlock(&object->lock);
   721
   722          if (page) {

	check

   723                  fscache_set_op_state(&op->op, "Store");

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-22 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 12:07 fscache: bug report: dereferencing before checking Dan Carpenter
2010-03-22 12:47 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox