On Thu, 21 Jul 2011, Vasiliy Kulikov wrote: > +bool slab_access_ok(const void *ptr, unsigned long len) > +{ > + struct page *page; > + struct kmem_cache *s = NULL; Useless assignment. > + unsigned long offset; > + > + if (!virt_addr_valid(ptr)) > + return true; > + page = virt_to_head_page(ptr); > + if (!PageSlab(page)) > + return true; > + > + s = page->slab; > + offset = (ptr - page_address(page)) % s->size; > + if (offset <= s->objsize && len <= s->objsize - offset) > + return true; I thought this was going to be offset < s->objectsize ...? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>