coverity#1257736 Explicit null dereferenced

Change-Id: I2cd312255f80e22ead614d0ea12a2130fb8bbeaa
coverity#1257735 Logically dead code

Change-Id: Ia96d9b4ead01e6ba68d97e933cae7c97a75efdf1
coverity#1242728 Use of untrusted scalar value

and

coverity#1242836 Use of untrusted scalar value
coverity#1242927 Use of untrusted scalar value
coverity#1242937 Use of untrusted scalar value
coverity#1242942 Use of untrusted scalar value

Change-Id: I66b602c27ee78ba80baab74dfb49ae90df45cbdc
coverity#1257108 Explicit null dereferenced

Change-Id: Ic4d9c99c8a2b994cec8828808d02a46ec6a18e2c