Your patch introduces new (internal) API and you don't test for the validity of the passed in pointer to "top". That needs to be fixed.
Your patch introduces new (internal) API and you don't test for the validity of the passed in pointer to "top". That needs to be fixed.