Re: [PATCH] ksm: fix rare page leak

From: Izik Eidus
Date: Mon Sep 21 2009 - 09:04:43 EST


Hugh Dickins wrote:
In the rare case when stable_tree_insert() finds a match when the prior
stable_tree_search() did not, it forgot to free the page reference (the
omission looks intentional, but I think that's because something else
used to be done there).

Fix that by one put_page() for all three cases, call it tree_page
rather than page2[0], clarify the comment on this exceptional case,
and remove the comment in stable_tree_search() which contradicts it!

I feel small embarrassment, I probably copy-pasted the body of unstable_tree_search_insert() when I wrote it.
Good catch Hugh.

Acked-by: Izik Eidus <ieidus@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/