|
@@ -605,7 +605,7 @@ long st_unregister(struct st_proto_s *proto)
|
|
pr_debug("%s: %d ", __func__, proto->chnl_id);
|
|
pr_debug("%s: %d ", __func__, proto->chnl_id);
|
|
|
|
|
|
st_kim_ref(&st_gdata, 0);
|
|
st_kim_ref(&st_gdata, 0);
|
|
- if (proto->chnl_id >= ST_MAX_CHANNELS) {
|
|
|
|
|
|
+ if (!st_gdata || proto->chnl_id >= ST_MAX_CHANNELS) {
|
|
pr_err(" chnl_id %d not supported", proto->chnl_id);
|
|
pr_err(" chnl_id %d not supported", proto->chnl_id);
|
|
return -EPROTONOSUPPORT;
|
|
return -EPROTONOSUPPORT;
|
|
}
|
|
}
|