host/mesh: comp pointer check

comp data pointer check before using

This is port of d466a807ee20670e90169eb2ad36996210277893
This commit is contained in:
Krzysztof Kopyściński
2021-11-10 06:24:00 +01:00
committed by Krzysztof Kopyściński
parent 53d610b73d
commit c3a4b94f6f
+1 -1
View File
@@ -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;
}