Incorrect casting is possible in 6.1 stable release using ESR_ELx_EC_* constants. The problem has been fixed by the following upstream patch that was adapted to 6.1. The patch couldn't be applied clearly but the changes made are minor. Found by Linux Verification Center (linuxtesting.org) with SVACE.