Fix unreachable code when using pass_hal_save_memory_initdata() by returning the
error code if failed. Before this patch, the usage code of
pass_hal_save_memory_initdata() is not able to receive the any error code.
Change-Id: Iba1af390efe74847f384ca60048fe32fbe07b1ab
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
*/
static int pass_hal_save_memory_initdata(struct pass_resource *res)
{
- struct pass_resource_init_data *initdata = &res->init_data;
+ struct pass_resource_init_data *initdata;
+
+ if (!res)
+ return -EINVAL;
+ initdata = &res->init_data;
initdata->memory.fault_around_bytes
= pass_hal_get_fault_around_bytes(res);