The gpio_vreg_request_gpio() function inside of the msm-gpio-regulator driver can return successfully even if gpio_request() has failed. This can lead to a kernel crash via null pointer dereference when later gpio and regulator functions are called. Modify gpio_vreg_request_gpio() so that it returns an error immediately if gpio_request() fails. Change-Id: I59364eb9efda6c2149b807db9a00e782d8ae6bb8 Signed-off-by: David Collins <collinsd@codeaurora.org>