Tools running for sanity checks are
detecting buffer overrun which is
not the case. Still getting rid of
function which is causing the issue
removed and making the code more robust
using defensive programming so that
any tool is not able to detect issues
hereafter. Fixed comments, corrected
typos and added a new return type
which is required as per refactoring
Signed-off-by: Ashutosh Mishra <ashutosh.mishra@amd.com>