host/mesh: comp pointer check
comp data pointer check before using
This is port of
@@ -328,7 +328,7 @@ int bt_mesh_comp_register(const struct bt_mesh_comp *comp)
int err;
/* There must be at least one element */
- if (!comp->elem_count) {
+ if (!comp || !comp->elem_count) {
return -EINVAL;
}
