If we hit this error path we end up returning ERR_PTR(0) which is NULL.
The caller is not expecting that so it results in a NULL dereference.
Fixes: 410ed13cae39 ("Add the mlxfw module for Mellanox firmware flash process")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Yotam Gigi <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
if (memcmp(comp_data->buff, mlxfw_mfa2_comp_magic,
mlxfw_mfa2_comp_magic_len) != 0) {
pr_err("Component has wrong magic\n");
+ err = -EINVAL;
goto err_out;
}